Help with variables

Hello!

I have this script

function OnTriggerEnter (other : Collider) {
if(used == false)
{
// Find the child named “ScoreHolder”.
// On the OtherScript attached to it, set score ++.
transform.Find(“ScoreHolder”).GetComponent(Counter).score ++;
}
}

function OnTriggerExit (other : Collider) {
if(used == false)
{
used = true;
}
Destroy(destroyedobj);
}

that every time the “player” walk into a “box”, the other script

var score : int = 0;

function Update () {

if(score == 5)
{
//something happens
score = 0;
}
}

change the score,but the object with the second script must be a child to the first one.
The problem is that I can’t have the second script a child to every “box” that the “player” walks into…

What can I do? Please help…

Make a script like this:

function OnTriggerEnter (other : Collider)
{ 
    if(other.gameObject.tag == "Player")
    {
	    other.gameObject.SendMessage ("ApplyScore", incomingScoreValue);
	    GameObject.Destroy(gameObject);
    }
}

And attach is to the boxes.

Then on any of the player’s scripts you put a function like this:

function ApplyScore(incomingScore:int)
{
	//do whatever you want with the score
}

Put the second script in a child of the player object and the first one on the player.