Problem with a score script

Hi,

I'm creating a very basic 2D platformer. I have already the basic move functions working. But now i'm trying to make a score script. The idea is that if you hit a red square that you get 1 point. I added a box collider to it that is triggered and i already have the +1 point working, the only problem now is that when i hit the red square, every red square in the scene dissapaers. Every red square is tagged 'score'

This is a part of my move around script:

static var score : int = 0;
static var AmtScoreHits : int = 0;

function OnTriggerEnter(hit : Collider)
{
if(hit.gameObject.tag == "score")
{
score = score+1;
AmtScoreHits = AmtScoreHits +1;
}
}

And this is the script atached to the red square, the score object:

function Update()
{
if(MoveAround.AmtScoreHits == 1)
{
Destroy(gameObject);

}
}

And sorry if they're a lot of spelling mistakes but i come from Belgium ;)

Try this...

if(hit.gameObject.tag == "score")
{
score++;
AmtScoreHits++;
Destroy(hit.gameObject);
}

This will destroy the gameObject that collides immediately when you pick it up. If you don't want to destroy it immediately, it looks like you are doing everything right EXCEPT this line...

if(MoveAround.AmtScoreHits == 1)

I'm guessing MoveAround is a script? The problem here is that the variable AmtScoreHits in MoveAround is 1 for everything, so every red square is getting that same script and triggering the destroy function.