The newbie needs help

I want to make it so that something is password protected but I can’t figure it out. I’m using “get input” and then trying to us “if” to make sure the password that is submitted is correct but I can’t seem to find a way to do it.

The simplest way would be something like:

msg ("Enter password:")
get input {
  if (result = "swordfish") {
    msg ("Access granted!")
    // code here to open a door, or whatever else the password does
  else {
    msg ("Incorrect")

I would probably use Trim (LCase (result)), so that it doesn't matter if the player remembers capital letters, or puts an extra space in the input.

If you have a problem, it would be useful to post the code you're using, what you expect it to do, and what it does when you try it.


Log in to post a reply.