Trying to proceed to next level when multiple items have collided

Blockquote

    var score : int 0;
    var gui : GUISkin;
    var buttonReady : boolean = false; 
     
    function OnTriggerEnter(other : Collider ) {
        if (other.tag == "item") {
            score += 1;
            Debug.Log("Score is now " + score);
        }
      }
     
    function Update () {
    if ( score > 5) {
    	Application.LoadLevel (0);
    	}
    }

I have this script that I am trying to use to change a level when 6 of these objects are touching the object that has the script attached. Unfortunately I cannot get it to work, can anyone help?

You are just missing an ‘=’ in the first line. The line should be:

 var score : int = 0;

Note when posting compiler errors, please include a copy of the error from the console. It tells us what line is having the problem and the stack trace.

Also, I suggest always having ‘#pragma strict’ at the top of the file. It can make for better performing code and will cause some runtime errors to be found at compile time.