When health is 0, character still lives

Hi all. I’m a total programing noob, and This script wont work. The idea is, when the health <= 0, he it should Destroy Object. However, nothing happens, and the Health counter simply goes negative, forever… Any ideas? Thanks in advance.

var destroyedPrefab : GameObject;
var destroyedPrefabfx : GameObject;
var health : int = 3;
private var damage : int = 1;
  
function OnCollisionEnter (col : Collision)
{
  if(col.gameObject.tag=="Enemy")
 {
 health -= damage;
 }
 }
 
function update (){

 if(health <= 0)
 {
 Destroy(gameObject);
 Instantiate(destroyedPrefab, transform.position, transform.rotation);
 Instantiate(destroyedPrefabfx, transform.position, transform.rotation);
 var guiText = GameObject.Find("GUI Text").GetComponent(GUIText);
 guiText.text = myNiceVariable;
}
}

Here is my script as reference(note that this is from another script, but the basics should remain):

EDIT: Also, consider trying “Destroy(this.gameObject)”

void calcDmg()
{
	{
		targetHp = player.GetComponent <PlayerStats>().hp;
		if(targetHp - atk > 0)
		{
			player.GetComponent<PlayerStats>().hp = targetHp - atk;
			Debug.Log ("You took " + atk + " damage!");
		}
		else
		{
			player.GetComponent<PlayerStats>().hp = 0;
			Debug.Log ("You have been killed.");
			playerIsDead = true;
		}
	}
}

Your Update function is probably not being called.

Needs to be capitalized: function Update() rather than function update().