How to collect items to add up

var KillTime = 2.5;

function OnTriggerEnter(hit : Collider)
{

   if(hit.gameObject.tag == "Player")
  {

      animation.Play("crate");
      PlayerStats.CRATES +=1 ;

      Destroy(gameObject,KillTime);

    }
}

here i have my script to collect crate however if i bump in to the same crate more than once it just keep adding how would i add the crate count it so that when i hit the crate it addes but if i hit the same crate again make it do nothing.

please help thanx ;) :)

you could change the code to just add a simple boolean in:

var KillTime = 2.5;
private var isHit = false;

function OnTriggerEnter(hit : Collider)
{
    if(!isHit && hit.gameObject.tag == "Player")
    {
        isHit = true;
        animation.Play("crate");
        PlayerStats.CRATES +=1 ;

        Destroy(gameObject,KillTime);
    }
}