Play Sound on Score

I am trying to play a sound when a score is reached and I can't get anywhere.

var Score : int =0;

var ScoreSound : AudioClip;

function Update () {

guiText.text = "Score "+Score;

if(Score >= 1000)

    Boo();

}

function Boo(){

    audio.clip = ScoreSound;
    audio.PlayOneShot(ScoreSound);
    yield WaitForSeconds (audio.clip.length);
    yield WaitForSeconds (5);
    Application.LoadLevel ("WinMenu"); 

}

I think the problem is with `if(Score >= 1000)` - I tried == but no luck. The sound will keep playing because the score is greater or equal than 1000.

in Boo() function add this line:

Score =0;

it'll immediately stop the if statement from calling the function every frame.

you should add an if statement which is true when the sound hasn't been played and which truns false when the sound is played.

var Score : int =0;
var ScoreSound : AudioClip;

function Update () {
guiText.text = "Score "+Score;
if(Score >= 1000) 
Boo();
}

var playSound = true;

function Boo(){
if(playSound==true); {
   audio.clip = ScoreSound;
   audio.PlayOneShot(ScoreSound);
   yield WaitForSeconds (audio.clip.length);
   yield WaitForSeconds (5);
   Application.LoadLevel ("WinMenu");
   playSound = false;
   }
}

I haven't tested it but I thought it would world