iffy about my maze.

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);