Scripting error

I’m trying to enter in a simple “Enemy Health” script but it keeps telling me UCEOOO1: Expected ’ ; ’ Insert semi-colon at the end. but i cant locate where it would go every where iv tried has popped up more error signals. please give me some advice for if this happens again thanks.

#pragma strict

var Health = 100;

function update () {
	if ( Health <= 0) { 
		Dead(); 
	}
}

function ApplyDamage (Damage : int) {
	Health -= Damage;
}

function () {
	Destroy (gameObject); 
}

For future posts:

  • Please format your code. After pasting your code into the question, select your code and use the 101/010 button.
  • Please use one of the common indentation styles. It makes your code more readable for others, and makes some matching brace bugs pop out (I fixed this when I formatted your code).
  • Please include a copy of the whole error from the console. It tells us what line the error occurred on along with a stack trace.

Your problem is on line 15. You forgot the ‘Dead’ name for your function. The line should be:

function Dead() {