void cannot be used in a boolean context

Please help it says that for line 19. Please help :smiley:
var bool : boolean = false;

function Update () {
}

function OnGUI () {
 // This draws a button in the left top corner of the screen which says Player Stats and if you click on it it changes the boolean bool to the opisite to what it is at the moment

       if (GUI.Button (Rect (Screen.width - 90, 0, 100, 20), "Player Stats")) {
           bool = !bool;
        }
       // Draws the stats box ad labels if the boolean bool is true;    
       if(bool) {
      		GUI.Label (Rect ( Screen.width / 2 - 175, Screen.height / 2 - 300, 350, 350), "Stats");	// This draws a large GUI box with the word "Stats" at the top
      		GUI.Label (Rect (Screen.width / 2 - 170, Screen.height / 2 - 275, 350, 350), "Health: " + PlayerHealth.curHealth); // The draws a HUI label which displays the players health
       		GUI.Label (Rect (Screen.width / 2 - 170, Screen.height / 2 - 260, 350, 350), "Weapon Strength: " + Firearm.weaponStrong); // This draws a GUI label which displays the weapon strenght
       		GUI.Label (Rect (Screen.width / 2 - 170, Screen.height / 2 - 245, 350,350), "Ammo : " + Firearm.Ammo); // This draws a GUI label which show the play how much ammo they have
      		
      		if (GUI.Label (Rect ( Screen.width / 2 - 170, Screen.height / 2 - 230, 150, 150), "Upgrade Weapon Strenght"))
       		{
       		   Firearm.weaponStrong += 5;
       		}
 
  		
}

}

You’re executing GUI.Label as if it returns a boolean value. It doesn’t return a value at all, so you can’t use it in an if statement.

if (GUI.Label (Rect ( Screen.width / 2 - 170, Screen.height / 2 - 230,
    150, 150), "Upgrade Weapon Strenght"))            
{
  Firearm.weaponStrong += 5;
}

The GUI.Label documentation makes this clear. Do you mean to have a button here?