Shoot script help

Hey can you help me. I have a shoot script that lets you reload. Can you tell me how to set it so you can’t reload if you have full ammo.

My script

var prefabBullet:Transform;
var shootForce:float;
var shots : int = 0;
var maxShots : int = 0;
var shootSound : AudioClip;
function Update()
{
    if(Input.GetMouseButtonUp(0) && shots < maxShots)
    {
        var instanceBullet = Instantiate(prefabBullet, transform.position, Quaternion.identity);
        instanceBullet.rigidbody.AddForce(transform.forward * shootForce);
        audio.PlayOneShot(shootSound);
        shots++;
    }
    else if (shots <= maxShots && Input.GetKeyDown(KeyCode.R))
    {
        shots = 0;
    }
}

In else if (shots <= maxShots && Input.GetKeyDown(KeyCode.R))

You have to change the shots <= maxShots to shots != maxShots

And not to use else

And the shots have to shots = maxShots

Here the full script

var prefabBullet:Transform;
var shootForce:float;
var shots : int = 0;
var maxShots : int = 30;
var shootSound : AudioClip;
var reloadTime : float = 1.0; //<--if you want to wait a time to reload
var reloading : boolean = false; //<--if you want to wait a time to reload

function Update()
{
    if(!reloading && Input.GetMouseButtonUp(0) && shots < maxShots)
    {
        var instanceBullet = Instantiate(prefabBullet, transform.position, Quaternion.identity);
        instanceBullet.rigidbody.AddForce(transform.forward * shootForce);
        audio.PlayOneShot(shootSound);
        shots--;
    }

    if (!reloading && shots != maxShots && Input.GetKeyDown(KeyCode.R))
    {
        Reload();
    }
}

function Reload()
{
    reloading = true;
    yield WaitForSeconds (reloadTime);
    shots = maxShots;
    reloading = false;
}