GUI text not updateing

I’m trying to do a health system via GUItext heres the code I have for the GUIText its in java script but here

var score = 0;
function Update () {
var text = "Health: ";
guiText.text = text + score.ToString();
}

and heres the code I have for when the zombie collides with the player

var score = 1; 
var GUIhealth : GUIText;

function OnTriggerEnter( other : Collider ) 
{ 
if (other.tag == "zom") 
{
score++; 
GUIhealth.text = score.ToString();
} 
}

but the text isnt updateing when the zombie hits the player the gui text is named GUIhealth but it isnt working:/ what am I doing wrong?

You are doing twice the job: first in the GUIText script - where you do it the wrong way, since its score variable is never modified by the player’s health - and in the player’s script, where it should work. Delete the Update function from the GUI script (or the entire script, if there’s nothing else in it).