Wait Until Sound is Finished

So I have a Custom Weapon with Custom Animation attached to my player. When the player Left-Clicks it plays the animation and sound. However if the player repeatedly left clicks the sound restarts over and over again interrupting itself. How can I tell the engine in JavaScript, to wait a certain amount of time before playing the sound again? I’m using the sound attached to the weapon as a AudioSource Component. Here is the code I’m using to play the animation and sound.

function Update () {

if(Input.GetButtonDown("Fire1"))
{
   	
   	animation.Play("Punch");
    audio.Play();
    
}

}

function Update () {

if(Input.GetButtonDown("Fire1")&& !animation.isPlaying)
{    
    animation.Play("Punch");
    audio.Play();
}   
}

It will check if the button is pressed AND if the animation is not playing. If it is still paying it returns false, no action.

Edit: You have the same members variable for audio.isPlaying. Note it is not a function so no ()

You probably want to use Wait for seconds. It stops and waits for a passed in amount of time.I linked the scripting help for you. Hope this helps.

WaitforSeconds