Searched the forum, and couldn't really find a thread to help me, neither could I fully understand the one on the wiki, so I hope maybe one of you guys can make me understand a bit more
So I've been trying to understand how "if" actually works, I know it's something with locked door got state 0 and unlocked like 1, and if it's 1 something happens, and 0 something else happens, but i have no clue how to script it, and where to put which line of code
This is my script, and what I wanna do is remove the message after the door is unlocked :o
So when the player interacts with the door, display the "Locked Door" message only IF the door is locked, and if it isn't locked, it will do nothing when interacted.
(05-30-2011, 04:13 PM)DannieWest Wrote: Thanks alot (To both of you x))
I wonder though, Apjjm, do it have to be named DoorUnlocked, or is that just a name so you know what you're doing?
You have to give the variable a name, in this case it was called "DoorUnlocked" as that both made sense and was unique. Kyles method is the better option for you to use in this case though.
The return statement will actually return out of that function at that point in the code, which can be used to stop the code executing further on a certain condition (though the same effect is provided by the "else" construct).
(This post was last modified: 05-30-2011, 05:24 PM by Apjjm.)