Stopping ammo to be able to pick up.

Hi, im nearly done with my FPS and there was one problem through final testing. So you start off with 30 ammo and a text on the bottom right hand corner, you can fire until a text come up saying OUT OF AMMO, but the ammo pickup was able to be picked up when you had ammo and if you were OUT OF AMMO. All I am asking is for someone to help me so that the ammos only able to be picked up when OUT OF AMMO.

SHOOT SCRIPT:
private var nextspawn : float;
var spawndelay : float=0.1;
var projectile : Rigidbody;
var speed = 10;
var ammo : int;
var a : float;
var b : float;
var c : float;
var d : float;
function Start () {
ammo = 30;
}

function Update () {

if (Input.GetButton ("Fire1"))
{
        if (Time.time>nextspawn){
        nextspawn=Time.time+spawndelay;
        
        if(ammo > 0)
        {
        ammo --;
        clone = Instantiate(projectile, transform.position, transform.rotation);
        clone.velocity = transform.TransformDirection(Vector3 (0, 0, speed));

        Destroy (clone.gameObject, 5);
        audio.Play();
        particleSystem.Play();
        }
        }
    }
} 

 
function OnGUI()
{
    if(ammo > 0)
    {
        GUI.color = Color.green;
        GUI.Label(Rect(1000,500,75,75),ammo.ToString());
    }

    if(ammo == 0)
    {
        GUI.color = Color.red;
        GUI.Label(Rect(1000,500,50,50),"Clip out of Ammo");
    }
}

AMMO SCRIPT:
#pragma strict
var shootObject : GameObject;
function Start () {
shootObject = GameObject.FindWithTag(“shooter”);
}

function OnTriggerEnter(other: Collider)
{
    if(other.tag == "ammo")
    {
        shootObject.GetComponent(Shoot).ammo +=50;
        Destroy(other.gameObject);
    }
}

All you need to do is clarify your if statement that gates access to giving the player more ammo. In this case, you need to check if the ammo is indeed empty.

     function OnTriggerEnter(other: Collider)
     {
         if(other.tag == "ammo" && shootObject.GetComponent(Shoot).ammo <= 0)
         {
             shootObject.GetComponent(Shoot).ammo +=50;
             Destroy(other.gameObject);
         }
     }