How to close a GUI window

Hello again everyone,

I'm trying to make a pause menu for my game, and i have it done except for one thing, i can't get my resume game button to work. So the question here is how to i make it when i press the button, the GUI box closes and the timescale go back to normal? I've looked all over the scripting reference page but found nothing, help is greatly appreciated.

-edit- Ok, heres my code(new code actually) which still doesn't work

function OnGUI() {
if (Input.GetButton("Esc"))
	pause
if (paused) {
		GUI.Box (Rect (500,500,105,90), "Pause Menu");
		Time.timeScale = 0

	if (GUI.Button (Rect(250, 250, 40, 25), "Resume")) {
			paused = false;
		}
	}
}

It's hard to tell without seeing your existing code, but I would think it you would want something like this:

function OnGUI() {
    if (paused) {
    	//Code to draw window...
    	if (/* Function call for resume button */) {
    		paused = false;
    	}
    }
}

This is how i did my pause in game. Hope it will help you.

if(Input.GetKeyDown("p")) //checking if P button was pressed

{

if(Time.timeScale == 1) //if game was not paused it will pouse the game

{

audio.volume = 0.1; //making music volume in background to be lower print("Pause"); //for testing only Time.timeScale = 0; //pousing the game

}

else if(Time.timeScale == 0) //if game was paused it will start the game

{

audio.volume = 0.5; //making music volume in background to be louder print("Start"); //for testing only Time.timeScale = 1; // continuing the game

}

}