Simple Health

its me again today with another script. it shows again some compiler errors… its disgusting:D

heres it:

var playerHealth = 120;
var GameObject = Transform;

function OnColliderEnter() {
playerHealth - 5; //5 is the bullet damage
}
function Update () {
if (playerHealth <= 0);
destroy.GameObject; //kill the player gameobject
}

thanks for answers!

Have a look at Update the if needs some semicolons, and inside

var playerHealth = 120; 
var GameObject = Transform;

     function OnColliderEnter() 
        { 
             playerHealth - 5; //5 is the bullet damage 
        } 
        
        function Update () 
        { 
             if (playerHealth <= 0) destroy.GameObject; //kill the player gameobject  -- Here there was an extra semicolon after the if statement
        }