hi can someone please help me quickly with this code

Hi can someone help me quickly i got an error which was :

Assets/Target.js(5,4): UCE0001: ';' expected. Insert a semicolon at the end

which i understand means put a ";" at the end of the line but i did and it wont go away ... look heres the code:

function Update () { var killCount; int killCount = 0; var globalCounter:GameObject = GameObject.FindWithTag("GlobalVars"); if (gameObject.Find("SmallTurret").hit) { globalCounter.killCount += 1;

print("kill count is now: "+globalCounter.killCount); }

}

Here is your problem:

var killCount; int killCount = 0;

Below is correctly formatted code with the fix applied. Pay close attention to the variable declaration for killCount.

function Update () { 
var killCount: int;
var globalCounter : GameObject = GameObject.FindWithTag("GlobalVars"); 

killCount = 0;

    if (gameObject.Find("SmallTurret").hit) { 
        globalCounter.killCount += 1;
        print("kill count is now: "+globalCounter.killCount); 
    }

}