Variable/frame problem :(

Hi there, it’s my first time actually posting on kirupa :slight_smile:
Well here’s the dilemna…
I’m planning to make a small rpg game involving with many fram jumping.

Here’s my problem.
I already defined a Hit point variable as “hp”
On my action layer i put.

hp = 50;

Then once the hero is attacked by the enemy, the enemy has a code inscribed:

_root.hero.gotoAndPlay("hit"); 
_root.hp = _root.hp -= (25 + random(5));

now… the problem… I put on my first frame of my action layer the action

 if (hp < 0)
gotoAndPlay("LOSE");

The hero ends up having -12323 and is still fighting the unbeatable enemy… Is the code incorrect? I tried to make the battle scene jump to the “lose” screen, but no luck… any help?

thanks!