GUI.Box inside of GUI.Button doesn't appear

Hi all, as first, sorry for my bad english.

Don’t you know why GUI.Box inside of GUI.Button in my script does not appear?
I wanted it worked like if you clicked on the GUI.Button, then GUI.Button will disappear and GUI.Box will appear.
Here is the script:

static var TotalHP : int = 100;
static var TotalMB : int = 60;
static var TotalDamage : int = 10;
static var TotalDefence : int = 15;


function OnGUI() {



if(GUI.Button(Rect(Screen.width / 70, Screen.height / 1.15, 50, 50), "Stats")) {

    GUI.Box(new Rect(Screen.width/35, Screen.height / 1.8, 300, 300), "HP: " + ManaAndHealth.curHP + " / " + TotalHP + "

" +
"MB: " + ManaAndHealth.curMB + " / " + TotalMB + "
" +
"Damage: " + TotalDamage + "
" +
"Defence: " + TotalDefence + "
");

       }               
}

Thank you for any response!

You should do something like this:

static var TotalHP : int = 100;
static var TotalMB : int = 60;
static var TotalDamage : int = 10;
static var TotalDefence : int = 15;
static var showBox : boolean = false;
     
     
function OnGUI() {
     
     
    if (!showBox){ 
        if(GUI.Button(Rect(Screen.width / 70, Screen.height / 1.15, 50, 50), "Stats")) {
            showBox = true;
        }
    }
    else{
        GUI.Box(new Rect(Screen.width/35, Screen.height / 1.8, 300, 300), "HP: " + ManaAndHealth.curHP + " / " + TotalHP + "

" +
"MB: " + ManaAndHealth.curMB + " / " + TotalMB + "
" +
"Damage: " + TotalDamage + "
" +
"Defence: " + TotalDefence + "
");

    }
}

Try using GUI.RepeatButton instead.

If you want a toggleable Box, use GUI.Toggle.

private var isBoxToggled : boolean = false;
    
function OnGUI () {
     isBoxToggled = GUI.Toggle(Rect(0, 0, 50, 50), isBoxToggled, "Show Box!");

     if(isBoxToggled) //GUI.Box code here
}