So, I am not exactly a pro at Unity scripting. I mean, I am great at placing objects and making them look pretty but scripting isn’t exactly my thing. So I tried fixing my script by just throwing brackets and semicolons in places and it ended up making it worse.

I decided to just take a screenshot of my errors to make things easy.

alt text

Here is my code. I am trying to make it so I can set the health to 0 with the press of a button.

var Health = 100;

function ApplyDammage (TheDammage : int)
{
	Health -= TheDammage;
	
	if(Health <= 0)
	{
		Dead();
	}
}

function Dead()

{

function update() {

if (Input.GetKeyDown("k")) {

	Health = 0;

	}
}

Thanks in advance for anyone who can help me fix this.

function Dead()
{
} // <---- you’re missing the closing brace here