Using AND or OR in IF ELSE statements doesn't work - Any solutions?
![](https://i.imgur.com/qLCkdtBb.png)
DaxAtDS9
14 Aug 2018, 12:59Hi,
I am still a beginner in JS, so maybe it's a stupid question. But I tried to mak some code with a specific logic work, but I failed.
Example for the logic:
There is no way to the west.
But there is a looked door.
You have to 1) unlock the door and 2) open the door.
If the door is unlocked AND it has been opened then the way to west will be shown.
So there is a room description:
blablablablablabla
Exits are:
North
South
I like to code:
[[Room]]:
Blablablablabla<br>
<br>
Exits are:<br>
[[North]](Room North)<br>
[[South]](Room South)<br>
{if unlocked=true && opened=true:[[West]](Room West<br>)}
But everything I've tried failed.
Someone here who has a solution?
Thanks!
Belén
14 Aug 2018, 14:17Try
{if (unlocked=true && opened=true):[[West]](Room West
)}
or just:
{if (unlocked && opened):[[West]](Room West
)}
![](https://i.imgur.com/qLCkdtBb.png)
DaxAtDS9
14 Aug 2018, 15:53Nope. Doesn‘t work
Belén
14 Aug 2018, 19:31True, doesn´t work. You need to anidate ifs:
{if unlocked:{if opened:{[[West]](Room West
)}}}
I have tested it and works properly.