you need to have a collider on the sword and the badguy, make sure the sword collider
has “isTrigger” checked in the editor. Then in the sword script you do:
function OnTriggerEnter(iCollider:Collider)
{
if(iCollider.transform.name == "name-of-badguy-object")
{
Destroy(iCollider.gameObject);
/*
use this if you want to destroy the badguy after some time (in seconds):
var TIME:int = 5;
Destroy(iCollider.gameObject,TIME);
*/
}