ID:164068
 
I will need to put a HP bar in my game, but the highest (nax)HP value will be changing. so I was wondering if someone could give me a code on how to make it so the HP bar increases/decreases using percents. like if you are punched and it will realize that your hp is less than 80% and change according to that. thanks.
current health / max health = the percentage between 0 and 1 (using decimals).

If you want it to be a value from 0 to 100, just times that value by 100.

Then simply make your health bar's icon_state be set to the resulting percentage.
make if statements
for example:
if (HP = 0)
flick "0HP"
if (HP = 1)
flick "1HP"
if (HP = 2)
flick "2HP"

do that all the way to one hundred although if i were you i would do it by increments of ten instead of doing every single one.
In response to Coco123
Bad idea, what if it is more than 100? Elation's post is more worthy of an idea than this
In response to Elation
Can you show that to me in a code?