Doube IF scripting:

Game Editor comments and discussion.

Doube IF scripting:

Postby d-soldier » Sun Jun 10, 2007 7:11 pm

I need to make an doube if statement, and can't seem to get it right... It needs to depend on two variables, such as:

if(shieldup = 0) & (udi_shield.textNumber=>0)
{
CreateActor("shieldtest", "shield00000", "(none)", "(none)", 0, 0, false);;
udi_shield.textNumber-=1;;
}

But this obviously isn't scripted correctly... anyone?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby pixelpoop » Sun Jun 10, 2007 7:24 pm

if(shieldup == 0 && udi_shield.textNumber>=0)
{
CreateActor("shieldtest", "shield00000", "(none)", "(none)", 0, 0, false);
udi_shield.textNumber-=1;
}

use double equals when doing a test and single "=" for assigning a new value.

use a double "&"

and use > before the equals sign.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby d-soldier » Sun Jun 10, 2007 7:27 pm

Ahhh, I thought the double && was right, but it didn't work when I tried it, plainly because the rest of the script was messed up. Thanks!
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron