How to ask the player a yes or no question

I need help with my code
Ask ("Are you sure you want to enter bottomless pit?") {
if (result = No) {
MoveObject (player, House)
}
else {
MakeObjectInvisible (Bottomless Pit)
}
}
For some reason i cant get the response to work with a No answer.


Ask converts the result to a boolean value; true or false.

The normal way to write something like that would be:

Ask ("Are you sure you want to enter bottomless pit?") {
  if (result) {
    MakeObjectInvisible (Bottomless Pit)
  }
  else {
    MoveObject (player, House)
  }
}

but if you really want to put the code for the 'No' option first, it would be:

Ask ("Are you sure you want to enter bottomless pit?") {
  if (not result) {
    MoveObject (player, House)
  }
  else {
    MakeObjectInvisible (Bottomless Pit)
  }
}

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

Support

Forums