How can i do a healthbar in choicescript?


#1

you know, when that variable is 0 the game ends (sorry, i’m spanish and its hard to talk in english)


#2

If in the stats screen, you can use the

*stat_chart
    percent (variable)

to display a bar.

For ending the game when a variable reaches zero, you can use *gosub commands to check if it’s zero or not, and use it to go to a scene where the game ends.

You can also use *if statements to check if the variable has reached zero, but the code will have to be copy-pasted to every instance where the variable has decreased.


#3
*stat_chart
   percent health HP

And when you want the game ends.

*if health <= 0
   game over
   tadaaa