Kyka Posted September 22, 2009 Ok, Ok, its a pretty simple line, but for all my wiki hunting and pulling-apart-of-others-coding, i can't figure out why it wont work. Script 4 (void) { If (CheckInventory("RedCard")) && (redkey = 0) { redkey++ other script stuff. } else { } } I want the script to check for both the player having a red key card and for the variable redkey to be zero, so you can only run the script once, even tho multiple linedefs can trigger it. Any help appreciated. Thanks. :) 0 Share this post Link to post
Jodwin Posted September 22, 2009 Kyka said: If (CheckInventory("RedCard")) && (redkey = 0) Check your parentheses. :) edit: Also, shouldn't it be "redkey == 0" and lowercase "if"? edit II: Please use the [code]-tags for posting code, makes life a bit easier. :) 0 Share this post Link to post
Kyka Posted September 22, 2009 Thanks Jodwin. Simple as moving a bracket. It's so obvious now that you have pointed it out. (As these things often are.) <-- Not a natural coder. (as if you can't tell). And I'll keep those [code] tags in mind for next time. 0 Share this post Link to post
Jodwin Posted September 22, 2009 Kyka said:<-- Not a natural coder. Misplaced (or simply forgotten) brackets happen to anyone; the problem here is that apparently the ACS compiler (or whatever it is that actually does most of the work) is bad at giving errors. More modern compilers (and/or debuggers) would have been able to tell what's wrong right away. 0 Share this post Link to post