Why Unknown identifier?

Hi guys. I'm trying write restart game code when something hit the floor:

function Start(){
    var thisLevel : int= Application.loadedLevel;
    print(thisLevel);
}

function OnTriggerEnter (other : Collider) {
    Application.LoadLevel (thisLevel);
}

I got: Assets/-MyScripts/RestartLevel-1.js(7,32): BCE0005: Unknown identifier: 'thisLevel'. Why 'thisLevel' is unknown?

thanks for any answer

You are declaring "thisLevel" in the local scope of the start function and the variable does not exist anywhere else.

Try the following:

var thisLevel : int;

function Start(){
    thisLevel = Application.loadedLevel;
    print(thisLevel);
}

function OnTriggerEnter (other : Collider) {
    Application.LoadLevel (thisLevel);
}