Increasing a score value?

Hello, this is the script for a projectile in my game. I want to make it so that when Object A collides with an object with tag B the score is increased, to put it simply, why doesn't this work?

> function OnTriggerEnter (other :
> Collider) {
>     if (other.gameObject.CompareTag ("Wall"))

{

    Destroy (gameObject);
};
if (other.gameObject.CompareTag

<p>("Enemy")) {
        Destroy (gameObject);
        Destroy (other.gameObject);
        {
    score += 1;

    if (score == 5)
    {
      displayScore(score);
    }
        };}
         function displayScore(int score)</p>

<p>{   GUI.Label(Rect(0, 0, 50, 50),
score); }</p>

do you want show score?

recommand below

{

int score = 0;

function OnTriggerEnter ( )

...

score++;

...

}

void OnGUI() { if (score == 5)

{

     GUI.Label(Rect(0, 0, 50, 50), score); 

}

}

}

static var Score : int;

now you can access this variable from any script by using scriptname.Score, being scriptname the name of the script you declared the variable into.