Gun Script not working help please

hello i made a gun script but my ammo counter is to working im not getting errors but its not working it is supposed to shoot when you have more then 0 but not fire when you have less then 0 but what it does is not shoot at all please help here is my script:

var bullet : Rigidbody;

var speed = 250;

var ammo = 12;

	 if(Input.GetButton("Fire1"));
	 if(ammo >0){
	  
	                           
                           
        bullet = Instantiate(bullet, transform.position, transform.rotation);
        bullet.velocity = transform.TransformDirection (Vector3.forward * 250);
}

	if(ammo <0){
	 bullet = Instantiate(bullet, transform.position, transform.rotation);
        bullet.velocity = transform.TransformDirection (Vector3.forward * 0);
}

please help

A semicolon right after a If statement will do nothing and will not throw any errors. Look at your GetGutton(“Fire1”), also the condition for when you have 0 ammo is never handled.

     if(Input.GetButton("Fire1"))
     {
        if(ammo >0)
        {
           bullet = Instantiate(bullet, transform.position, transform.rotation);
           bullet.velocity = transform.TransformDirection (Vector3.forward * 250);
           ammo--;
        }
        else   //if(ammo <= 0)
        {
           //bullet = Instantiate(bullet, transform.position, transform.rotation);
           //bullet.velocity = transform.TransformDirection (Vector3.forward * 0);
        }
     }

You forgot to put your script in an Update function. Also had a semicolon after your fire button check, so nothing happened even if the fire button was pressed. Try this :

var bullet : Rigidbody;
var speed : float = 250;
var ammo : int = 12;

function Update()
{
	if( Input.GetButtonDown("Fire1") )
	{
		if(ammo >0){
			bullet = Instantiate( bullet, transform.position, transform.rotation );
			bullet.velocity = transform.TransformDirection( Vector3.forward * speed );
			// remove one bullet
			ammo -= 1; // this is also written as ammo--;
		}
		if(ammo <0){
			Debug.Log( "No Ammo ..." );
		}
	}
}