Destroy GameObject and play sound

Hi there, i actually have this script for play song when i touch it

var stringToEdit = " ";
var showgui = false;
var playClip : AudioClip;

function OnGUI () {
    if (showgui) {
        // Make a multiline text area that modifies stringToEdit.
        stringToEdit = GUI.TextArea (Rect (10, 10, 300, 100), stringToEdit, 200);       
    }
}

function OnTriggerEnter(){
    showgui = false;
    audio.clip = playClip;
    audio.Play();
    }

My question is this…

if i put Destroy(gameObject); it destroys but not play the audio

the only problem is when i turn back and go in the trigger again, the sound begin again, so i want when im over the trigger it play the sound, but the triggers destroy and the sound is still playing.

thanks a lot

You need to wait for audio to complete playing and call destroy gameobject. That is you need a coroutine to do that, like

function OnTriggerEnter(){
    showgui = false;
    audio.clip = playClip;
    audio.Play();
    yield WaitForSeconds(2);
    Destroy( this.gameObject );
    }