Gui for ammos and grenades

hi theres some thing wrong BulletCollisions.Bullet_AMMO--; print("YOU NOW HAVE "+ BulletCollisions.Bullet_AMMO +" Bullets"); } } }

when i out this code it does go up but it doesnt update it self and stays that number.. for example you get 20 grenades and throw 10, it stays at 20 PLEASE HELP

Try this script:

var grenades = 20;

function Update () {
    if (Input.GetButton ("Fire1")) {
        grenades --;
        //Put your firing script here.

function OnGUI () {
    GUI.Label (Rect (25, 25, 100, 30), "Ammo: " + grenades);

Whenever you fire it outputs the amount of ammo you have and updates it on the screen. Note: This does not shoot a projectile. It just keeps track of your ammo.