next level script

hey im a newbie script writer and was wondering if somone could make/fix this script for me. what its going to do is there will be a global var on the turrets when they are destroyed it will increase the number.
please fix this for me:

var NextLevel = //level here
var KillCount = // how many you have to kill here

function update();
if static DeathNumber is equal to Killcount
go to next level

sorry I am an ex gamemaker gamemaker :slight_smile: thanks please help

function ATurretIsDestroyed ()
{
	KillCount = KillCount + 1;
	if (KillCount == DeathNumber)
	{
		Application.LoadLevel ("name of the level to load");
	}
}