cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1168
Views
0
Helpful
2
Replies

Simple Prompt using an if

David Rickard
Level 1
Level 1

Hi,

I'm modifying one of our scripts, and I want to have a main menu prompt play which also plays a message saying 'to hear these options again press star' - but to only play that last little bit once.

However, I can't get the expression editor to play nice!

I have a boolean variable set up in the script called PlayedListenAgain. I also have the prompts set as Prompts.

I added this script to the prompt expression for the menu:

{

if (PlayedListenAgain == true)

  Prompt promptMainMenu;

else

  Prompt promptMainMenu + promptHearOptionsAgain;

  PlayedListenAgain = true;

}

But it just errors saying "Unable to parse expression; promptMainMenu is already defined (line: 3, col:3).

Now, I'm well aware of this, I defined it! I'm not trying to redefine it, so I'm going a little nutty here.

Any help gratefully received!

1 Accepted Solution

Accepted Solutions

Jonathan Schulenberg
Hall of Fame
Hall of Fame

Try this:

{

if (PlayedListenAgain == true)

  return promptMainMenu;

else

  PlayedListenAgain = true;

  return promptMainMenu + promptHearOptionsAgain;

}

View solution in original post

2 Replies 2

Jonathan Schulenberg
Hall of Fame
Hall of Fame

Try this:

{

if (PlayedListenAgain == true)

  return promptMainMenu;

else

  PlayedListenAgain = true;

  return promptMainMenu + promptHearOptionsAgain;

}

Johnathan, you are a star!

Thankyou, sir. That worked!