Jump to content
Sign in to follow this  
brandeni

can't get super simple if then statement to work.

Recommended Posts

Hey guys :)

I have two triggers, that set the variable "keeplooping" to either "1" or "0". After it sets them, it then executes this script:

if (keeplooping = 1) then
{
	hint "keep looping is true";
}
else
{
	hint "keep looping is false";
};

However, the hint's do not appear. I have verified that the triggers are setting the variable, and that the script recognizes the variable (by putting a "hint str keeplooping" in at the start of the script)

Any ideas what might be going on?

Share this post


Link to post
Share on other sites
if (keeplooping == 1) then
{
	hint "keep looping is true";
}
else
{
	hint "keep looping is false";
};

Share this post


Link to post
Share on other sites

If you don't like "if" statements try to use "waitUntil{}" or "while{} do {}"

Share this post


Link to post
Share on other sites

Keep in mind if statements only execute once so a while loop is much better here.

Also make sure to use == ("equal to"), not = which is a simple assignment operator.

Share this post


Link to post
Share on other sites
Keep in mind if statements only execute once so a while loop is much better here.

Also make sure to use == ("equal to"), not = which is a simple assignment operator.

Oh thank you so much! That has to be it. I am going to try this tonight..

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×