Problem in code - opening door

I have created the code below so that if I type GO DOOR then there is a check to see if the door is open, if not a message is printed and if the door is open then the player is moved to another room.
All doors are containers that open and close aand are currently closed.

Doors 1 and 2 work but then I open door 3 and type GO DOOR I get the message "You can't walk through a closed door"

Any suggestions on what is causing this would be most welcome thanks.

if (ListContains(ScopeReachable(), Door 1)) {
if (Door 1.isopen) {
MoveObject (player, Front Room)
}
else {
msg ("You can't walk through a closed door")
}
}
else if (ListContains(ScopeReachable(), Door 2)) {
if (Door 2.isopen) {
MoveObject (player, Storeroom)
}
else {
msg ("You can't walk through a closed door")
}
}
else if (ListContains(ScopeReachable(), Door 3)) {
if (Door 3.isopen) {
MoveObject (player, Trash Bin)
}
else {
msg ("You can't walk through a closed door")
}
}


I just found out what was going wrong.
I originally had a script for when the player opens the door.
I later deleted that script but it looks like Quest leaves the beginnng and end parts of a script when the script is deleted so when I typed OPEN DOOR for door 3 then Quest tried to run my script (which was an empty script) instead of opening the door.
I fully deleted the open door script so now it is work OK.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums