Page 1 of 1

iffy about my maze.

PostPosted: Sun May 09, 2010 10:49 pm
by MrB
OK I am trying to limit the amount of goes a player has getting through a maze. I have set up a variable goes, and a script that is called every time the player is created. In the script I am trying to use an 'if' to call another actor, however the actor I want to call gets called everytime regardless. Here is the script what am I doing wrong?
Code: Select all
goes=goes+1;


if (goes = 4)CreateActor("win", "icon", "(none)", "(none)", -276, 0, true);

Re: iffy about my maze.

PostPosted: Sun May 09, 2010 11:04 pm
by Hblade
You only have 1 = sign in your if statement :3

correct way of if:
Code: Select all
if (val1 == val2)

if (val1>val2)

if (val1<val2)


Or you can do => and =< which mean equal or less, and equal or more :3

Re: iffy about my maze.

PostPosted: Mon May 10, 2010 5:27 am
by MrB
Aaah

so = means assign value to and == means check it is the same as.

Thank you so much for your help.

MrB

Re: iffy about my maze.

PostPosted: Mon May 10, 2010 6:15 am
by Hblade
No problem :D Yeah this happens to beginners