VGamingJunkie Posted May 30, 2012 I have; Script 27 (void) { if (CheckInventory("BlueCard") > 0); Floor_LowerToLowest(64,15); if (CheckInventory("BlueCard") < 1); print(s:"They're hiding something."); } To check for the Blue Keycard and having a message indicating it's locked if the player doesn't have the card. I tried using else but it claimed Invalid Statement. This script doesn't have errors but it doesn't seem to work in the actual game as it both displays the message and lowers the floor even though the player doesn't have the key card. 0 Share this post Link to post
Edward850 Posted May 30, 2012 Because you have stuck line endings at the end of checks. If you end a check before it runs a function, the check itself does nothing.{ if (CheckInventory("BlueCard") > 0) Floor_LowerToLowest(64,15); else print(s:"They're hiding something."); } 0 Share this post Link to post
Gez Posted May 30, 2012 Note that in some circumstances, you may want to use this deliberately: if (somecondition); else if (someothercondition) dosomething();Depending on the length of the expressions being evaluated, this can be a more legible way of writing:if (!somecondition && someothercondition) dosomething(); 0 Share this post Link to post