Page 1 of 1

code not working properly

PostPosted: Sat Jul 03, 2010 1:03 am
by DBGames
Code: Select all
if(textNumber==0);
{
    EventDisable("Helicopter", EVENTKEYUP);
}


this code should be self explanatory, but when the number of this actor hits 0. i want the key up even to stop making rockets.
ok i added to the code but the sencond part dosent work either now. the whole code is below.
Code: Select all
if(textNumber==0);
{
    EventDisable("Helicopter", EVENTKEYUP);
}
if(textNumber==0);
{
    EventDisable("Rocket_Amount", EVENTALL);
}

for this code, when thxt nubmer is zero i dont want it to lower any more. (no -1's and stuff)

Re: code not working properly

PostPosted: Sat Jul 03, 2010 3:29 am
by Bee-Ant
Don't use "textNumber"...
It's not a real number we can mess with...
Use variable instead.

Go to Script Editor, click Variable and add a new one. Say "Number".
On the text actor, put :
Code: Select all
textNumber=Number;

And fix your code into :
Code: Select all
if(Number==0);
{
    EventDisable("Helicopter", EVENTKEYUP);
}

Re: code not working properly

PostPosted: Sat Jul 03, 2010 6:11 am
by DBGames
it didnt work, now its always disabling event up

Re: code not working properly

PostPosted: Sat Jul 03, 2010 7:53 am
by Bee-Ant
DBGames wrote:it didnt work, now its always disabling event up

Of course if you didn't edit the code into :
Code: Select all
if(Number==0);
{
    EventDisable("Helicopter", EVENTKEYUP);
}
if(Number==1);
{
    EventEnable("Helicopter", EVENTALL);
}

And put :
Code: Select all
Number=0; //or
Number=1;

somewhere to switch the status...