How to get a float from another script into a gui text

Here is my code but i get and object reference error.
private Shoot currentbullets;

	void OnGUI()
	{
		guiText.alignment = TextAlignment.Left;
		guiText.text = "Ammo = " + Shoot.currentbullets;
	}

This is the other script
public class Shoot : MonoBehaviour
{

	public Rigidbody projectile;
	public float speed = 20;
	public float currentbullets = 0;
	public float totalbullets = 5;

	// Use this for initialization
	void Start () 
	{
		currentbullets = 5;
	}

	void Update ()
	{

		if (Input.GetButtonDown("Fire1"))
			{
				if(currentbullets > 0)
				{
					Rigidbody instantiatedProjectile = Instantiate(projectile,transform.position,transform.rotation)as Rigidbody;
					instantiatedProjectile.velocity = transform.TransformDirection(new Vector3(0, 0,speed));

					currentbullets--;
				}
			}
	}
}

Do you have the code for Shoot? It sounds like you’ve defined currentbullets as a private access member. Try putting public before it’s declaration.

So assuming currentbullets is an int:

public int currentbullets = ...YOUR VALUE HERE...

if you don’t like public variables you can also use a Property