Wait for reload to finish?

I have a script which covers most of my weapons shooting and reloading, but I have this problem when you press r you dont have to wait for the reload animation to finish instead you can press r and start shooting straight away. How would I alter this script so that you have to wait a few seconds before you can start shooting again?

this is the script,

var amountOfShots = 8;

function Update (){

if(Input.GetButtonDown(“Fire1”)){

Shoot();

}

if(Input.GetKeyDown(“r”)){

amountOfShots = 8;

}

}

var shootSound : AudioClip;

var bloodPrefab : Transform;

var sparksPrefab : Transform;

var hit : RaycastHit;

var range = 500;

function Shoot (){

if(amountOfShots > 0){

    amountOfShots--;

    if(shootSound){

    audio.PlayOneShot(shootSound);

}

if(Physics.Raycast(transform.position, transform.forward, hit, range)){

var rot = Quaternion.FromToRotation(Vector3.up, hit.normal);

if(hit.collider.tag == "Enemy"){

    if(bloodPrefab){

        Instantiate(bloodPrefab, hit.point, rot);

    }

        hit.collider.gameObject.SendMessage("ApplyDamage", 25, SendMessageOptions.DontRequireReceiver);

    }else{

    if(sparksPrefab){

        Instantiate(sparksPrefab, hit.point, rot);

        }

    }

}

}

}

var reloadTime = 2.5;
yield WaitForSeconds(reloadTime); // Waits

You should really search before you ask these questions they have already been answered.

http://unity3d.com/support/documentation/ScriptReference/WaitForSeconds.html

EDIT:
Update cannot be coroutined you will have to do your reload stuff in a new function:

var reloadTime = 2.5;

function Update (){
if(Input.GetKeyDown("r")){
    Reload(); //Calls the reload function 
    }
}

function Reload (){
yield WaitForSeconds(reloadTime);
amountOfShots = 8;
}

Now it should work. I am really sorry that I forgot to tell you about this. Now wonder it does not work.

Good luck.