Destroying something when bullet hits it

I was extremely curious if there was a way to fix my script or find out why its not working. I want to make it so when a bullet hits something, that thing gets deleted. This way I can have a stealth-ish game where you shoot security panels and it opens up a door, ect. I have not found any way what so ever to do this accept with the script I have designed that doesn’t even work. I was hoping someone could check it out and tell me what I did wrong or what I could do.

 #pragma strict

function OnTriggerEnter (other : Collider) {
 	if(other.tag == "Bullet") {
		Destroy (gameObject, 1);
	}
}

it would be coincident of you to help, thank u very much In advance

if(other.gameObject.CompareTag(“Bullet”)) {
Destroy(gameObject, 1);
}

Do both gameObjects have a mesh collider?
Is your gameobject’s Mesh collider checked as IsTrigger? (The one that has the script attached)
Do any of your gameobjects have a Rigidbody attached?
Is the other gameobject tagged as “Bullet”?
If these conditions are met then the trigger functions should work properly and the gameObject will get destroyed as you want.

Use:

function OnTriggerEnter (other : Collider) {
      if(other.tag == "Bullet") {
         Destroy (other.gameObject);
     }
 }

You need to specify that the thing you are hitting is the thing you want to destroy.