How To Make an Adding Total

Hi, I am creating a gamebook and for each option the player chooses correctly, the game will add one point to the score. If the player chooses incorrectly, nothing happens.

How do I get the points to add up and show at the end of the game?


player.score=player.score +1
(for each correct answer..)
at the end...
msg ("Your score was: " + player.score)

This works for Quest...


Do I put them in curly braces?


In the room description... Yes...
IE:
Your score was: {player.score}


To make it work, no, you don't have to put it in curly brackets. You take this, spaces included:

player.score = player.score + 1

And you put it either in rhe game's start script or the game's initialization script.


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

Support

Forums