getting score value for if script conditions

I'm making a text adventure game, but I need help.
I'm making a game which adds and removes score, then measures it for the final ending.
Having a score -10 or lower means that the player (who is a prototype robot) will be scrapped for parts.
Having a score 10 or higher means that the player will be sold to the public.
Having a score between those two means that the player will just be put to sleep until the next game.


Are you using the standard IncreaseScore and DecreaseScore functions?

If so, your score will be in the attribute game.score. So you would do something like:

msg ("Your final score was {game.score}.")
if (game.score >= 10) {
  msg ("Congratulations, you get sold!")
}
else if (game.score <= -10) {
  msg ("Oh dear, you're heading for the scrap heap!")
}
else {
  msg ("This adventure is over, so it's time to sleep until the next one.")
}
finish()

yes, i am using that.
thank you very much for the help.


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

Support

Forums