play sound when kill enemy

hi Im building a 2d shooter and want to add a sound to a script that kills enemies but cant get it working.

This is the script

var hitPoints = 10;

function can_die (damage) {
hitPoints -= damage; if( hitPoints
< 1 ) { Destroy(gameObject, 0.0);
} }

Ive tried adding

audio.PlayOneShot(Sound);

with an audio source but cant egt it working.

Any Ideas?

Thanks

the moment you destroy the object the script attached to it also get destroyed so no script no sound played

give a yield before destroying the object

function DestroyAfterYield(time : float)
{
     audio.PlayOneShot(Sound);
    yield WaitForSeconds(time);
    Destroy(gameObject);
}