Delete certain gameobject if it enters the area.

Hello. I am using this script to delete gameobjects in an area.

function OnTriggerEnter (other : Collider) {
Destroy(other.gameObject);
}

How can I delete specific gameobjects and not all of them?

Use tags to identify what object enters the trigger.

if(other.tag == "example") {
    Destroy(other,gameObject);
}