Stop Door Loop

I have a scene where I hit a switch and a door opens. My gun is a stream of particles. The problem I have is when I constantly shoot the switch, the door opens then loops and opens etc… How can I fix this so that it only plays the door animation once? I’ve tried things like booleans but that doesn’t work.
Here is the script applied to the switch:

var TheDoor : GameObject;

function OnParticleCollision () {

TheDoor.animation.Play(“opendoor”);
}

You need to set the Animation Wrap Mode to Once or Clamp Forever, depending on your use case.