The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
The "if" statement - by JordanWeigle - 03-20-2012, 08:05 PM
RE: The "if" statement - by Obliviator27 - 03-20-2012, 08:11 PM
RE: The "if" statement - by JordanWeigle - 03-20-2012, 08:16 PM



Users browsing this thread: 2 Guest(s)