Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The "if" statement
JordanWeigle Offline
Junior Member

Posts: 9
Threads: 3
Joined: Feb 2012
Reputation: 0
#1
Question  The "if" statement

Hai guys!
I wanted to ask of you to guide me a little bit as far as the "if" statement goes. Yes, I understand the very very basics of it, but I can't get it to work in my map.

Here's the scheme of use for the "if":
In the beginning I have set up a locked door that (obviously) requires a key. In doing the code, I decided upon setting a message to tell you whether or not you have the key. So, assuming you found the key and have it tucked away in your inventory, and then you click the door, it will say "I should use that key I found".
Assuming you HAVEN'T found it, it will say that you need to look around for one.
The problem is, I can't get the message to show up at all. I particularly think that I didn't even come close to getting the coding right when I made it.

if(HasItem("entrykey"))
{SetMessage("Messages", "Message1Alt", 0)
else
SetMessage("Messages", "Message1", 0)
}



If you could fix my code or teach me how to correctly write my own, I'd be much obliged.
03-20-2012, 08:05 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: The "if" statement

void FunctionThatIsCalledWhenClickingDoor (Syntax)
{
if(HasItem("entrykey"))
{
SetMessage script
}
else
{
Other SetMessage script.
}
}

03-20-2012, 08:11 PM
Find
JordanWeigle Offline
Junior Member

Posts: 9
Threads: 3
Joined: Feb 2012
Reputation: 0
#3
RE: The "if" statement

(03-20-2012, 08:11 PM)Obliviator27 Wrote: void FunctionThatIsCalledWhenClickingDoor (Syntax)
{
if(HasItem("entrykey"))
{
SetMessage script
}
else
{
Other SetMessage script.
}
}
Thanks! I'll try it now. I gave you a rep, just for your quick reply Wink
03-20-2012, 08:16 PM
Find




Users browsing this thread: 2 Guest(s)