Reload script not working

Hello dear people of Unityanswers. I got this script:

var Bullets = 32;
var reloadTime = 4;

    function Shoot()

    {
    if(canShoot)
        {
        var Bullet = Instantiate(Bullet,gameObject.Find("BulletSpawnPoint").transform.position,
        Quaternion.identity);

        Bullet.rigidbody.AddForce(transform.forward * 1000);           
        Bullets -= 1;

        if(Bullets == 0)
        {
        canShoot = false;
        WaitForSeconds(reloadTime);
        canShoot =  true;
        Bullets = 32;
        }
    }
}

The Shoot function is called from function Update. I am having truble making my character reload when the bullet count is 0. It should be simple but i cant make it work. Can you guys help a fellow out? That would be great :)

Maybe you should use something like this:

function Shoot() {
  if (Bullets > 0) {
    ...
  }
  else {
    yield WaitForSeconds(reloadTime);
    Bullets = 32;
  }
}

var bullets:int = 32;
var bulletPrefab: GameObject;
var reloadTime:int = 4;
var shotTime: float;
var canShoot:boolean = true;

function Shoot() {
    if(canShoot) {
        var bullet = Instantiate(bulletPrefab, gameObject.Find("BulletSpawnPoint").transform.position, Quaternion.identity);
        bullet.rigidbody.AddForce(transform.forward * 1000);
        bullets -= 1;
        if(bullets <= 0) {
            shotTime = Time.time;
            canShoot = false;
        }
    }
    else {
        if ((Time.time - reloadTime) >= shotTime){
            bullets = 32;
            canShoot = true;
        } 
    }
}

Try it this way. I didn't see where you declared "canShoot" outside of the Shoot() function, so that may have been your issue...