Keypad script problem

I can't figure out why the script doesn't work. I used the script from this website: http://docs.textadventures.co.uk/quest/guides/unlockdoor.html
I did the same thing as the second picture has, and I get this error: "Error running script: Error compiling expression 'result=1594': Unknown object or variable 'result'"
Image of my problem: https://imgur.com/a/Fz2LP8k
Be nice, I'm new :)


If it's saying result is unknown, you likely missed out the "get input" step.

Also, looking at that error message makes me think that you have some quotes missing. A result entered by the player will always be a string, and you can't compare strings to numbers. So your expression will need to be result="1594", not result=1594.


Thanks! Both things are missing, so I will add those right away.


I get this error now. What is wrong now?

use keypad
Please enter password:

1594
I don't understand your command.

Code:
msg ("Please enter password:")
get input {
if ( result="1594") {
UnlockExit (safe room)
}
else {
msg ("Incorrect code. Please try again.")
}
}


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

Support

Forums