Here you go:[attachment=0:escmbjqw][/attachment:escmbjqw]
The use of a global variable for player health wasn't necessary, so I deleted that. Instead you should've used the instance variable everywhere.
To the health bar going out of bounds I compared the instance variable to the max and minimal amount possible.
I've also added the condition is not flashing to the object damaging the player. That way the player doesn't instantly die when hitting/overlapping that object.