I tried it, but it still doesn't work. Here's what all my events for the healtbar look like:
Event: Player: on collision with enemy
Subevent: Healthbar: Animation frame<4 Action: Healthbar:set animation frame to Healthbar.Animationframe+1 Action: System: subtract 1 from Health
Event: System: Health = 0 Action: Restart layout.
I don't know if you'll be able to understand that or not. And the Health thing is my global variable. Thanks.