My buttons do not appear when paused?

I am trying to make my own puse script from various tutorials and snippets, it was going ok till i started to add buttons… At first they would appear even when not paused. not they don’t appear at all.

Maybe i am not putting it in the right place? i tried the ONGUI but it kept saying error.

//My First (Pause Menu) Script 4 July, 2013
// I'm sure it is full of errors lol, but it's a start!
// Im using what i am reading in tutorials, plus some code examples..

var paused : boolean = false;
var pausedGUI : GUITexture;
var gameName : String = "Game Paused";
var skin:GUISkin;
var pauseTexture : Texture2D;
var windowRect0 : Rect = Rect (670, 250, 150, 50);
var windowRect1 : Rect = Rect (670, 300, 120, 50);
var windowRect2 : Rect = Rect (670, 350, 120, 50);
var windowRect3 : Rect = Rect (670, 400, 120, 50);
static var backgroundColor : Color;

function Update () {

if(Input.GetKeyDown("p") && paused == false)
{

//IF GAME IS PAUSED
        paused = true;
        Time.timeScale = 0;
        AudioListener.pause = true;
        Screen.showCursor = true;
        GUI.backgroundColor = Color.blue;
        guiTexture.texture = pauseTexture;
        //GUISkin.CreateInstance new.skin;

} else if(Input.GetKeyDown("p") && paused == true) {

//IF GAME IS NOT PAUSED
paused = false;
AudioListener.pause = false;
Time.timeScale = 1.0;
Screen.showCursor = false;
}

}   
    function OnGUI () {
        //Make New Windows
        if(Input.GetKeyDown("p") && paused == true) {
        guiTexture.texture = pauseTexture;
        guiText.text = gameName;
        GUI.color = Color.green;        
        windowRect0 = GUI.Window (0, windowRect0, PauseWindow, "Resume Game");
        GUI.color = Color.yellow;        
        windowRect1 = GUI.Window (1, windowRect1, PauseWindow, "Load, Save Game");
        GUI.color = Color.yellow;        
        windowRect2 = GUI.Window (2, windowRect2, PauseWindow, "Load, Save Game");
        GUI.color = Color.yellow;        
        windowRect3 = GUI.Window (3, windowRect3, PauseWindow, "Load, Save Game");
        }
    }
    // Make the contents of the window.
    // The value of GUI.color is set to what it was when the window
    // was created in the code above.
    function PauseWindow (windowID : int) {
        if (GUI.Button (Rect (10,20,100,20), "Hello World"))
            print ("Got a click in window with color " + GUI.color);
        // Make the windows be draggable.
        GUI.DragWindow (Rect (0,0,10000,10000));
    }

Im trying to get it to appear as:
Game Paused
Button 1
Button 2
Button 3
Button 4
with a gray background image

Here try this dude:

var paused : boolean = false;
var pausedGUI : GUITexture;
var gameName : String = "Game Paused";
var skin:GUISkin;
var pauseTexture : Texture2D;
var windowRect0 : Rect = Rect (670, 250, 150, 50);
var windowRect1 : Rect = Rect (670, 300, 120, 50);
var windowRect2 : Rect = Rect (670, 350, 120, 50);
var windowRect3 : Rect = Rect (670, 400, 120, 50);
static var backgroundColor : Color;
 
function Update () {
 
    if(Input.GetKeyDown("p") && paused == false){
     
        //IF GAME IS PAUSED
        Time.timeScale = 0;
        AudioListener.pause = true;
        Screen.showCursor = true;
        GUI.backgroundColor = Color.blue;
        guiTexture.texture = pauseTexture;
        //GUISkin.CreateInstance new.skin;
        paused = true;
     
    } 

    else if(Input.GetKeyDown("p") && paused == true) {
     
        //IF GAME IS NOT PAUSED
        AudioListener.pause = false;
        Time.timeScale = 1.0;
        Screen.showCursor = false;
        paused = false;

    }
}
 

function OnGUI () {
    //Make New Windows
    if(paused == true) {
        guiTexture.texture = pauseTexture;
        guiText.text = gameName;
        GUI.color = Color.green;        
        windowRect0 = GUI.Window (0, windowRect0, PauseWindow, "Resume Game");
        GUI.color = Color.yellow;        
        windowRect1 = GUI.Window (1, windowRect1, PauseWindow, "Load, Save Game");
        GUI.color = Color.yellow;        
        windowRect2 = GUI.Window (2, windowRect2, PauseWindow, "Load, Save Game");
        GUI.color = Color.yellow;        
        windowRect3 = GUI.Window (3, windowRect3, PauseWindow, "Load, Save Game");
    }
}

// Make the contents of the window.
// The value of GUI.color is set to what it was when the window
// was created in the code above.
function PauseWindow (windowID : int) {
    if (GUI.Button (Rect (10,20,100,20), "Hello World"))
        print ("Got a click in window with color " + GUI.color);

    // Make the windows be draggable.
    GUI.DragWindow (Rect (0,0,10000,10000));
}

Let me know what happens (I’m not hugely familiar with GUI windows my self, to be honest)

Well I know that this isn’t exactly what you are trying to make but it should help you see if there is something wrong with your early script as this is the prototype pause I am using in a game I am currently developing.
#pragma strict

var pressed1 : boolean = false;
var pressed2 : boolean = false;
public static var paused : boolean = false;
var sX : int;
var sY : int;

function Start(){
	sX = Screen.currentResolution.width;
	sY = Screen.currentResolution.height;
}

function Update () {
if(Interaction.talking == false){
if(Input.GetKeyDown(KeyCode.Escape) && pressed1 == false && pressed2 == false){
pressed1 = true;
paused = true;
}

if(pressed2 == true && pressed1 == true){
pressed1 = false;
pressed2 = false;
paused = false;
}
}
}

function OnGUI(){

if(pressed1 == true){
	if(GUI.Button(Rect(sX - (sX / 2 + 50),sY - (sY / 2 + 50),100,50), "Continue")){
		pressed2 = true;
	}
	if(GUI.Button(Rect(sX - (sX / 2 + 50),sY - (sY / 2 - 10),100,50), "Quit Game")){
		Application.Quit();
	}
}

}

Please note that this script is also using the size of the screen for positioning so you can probably ignore all the sX’s and sY’s XD.

Hello, i don’t know what are you exactly trying to do, but i have a similar code in one game that pauses the game and shows a little menu to exit or restar the level, check it out, hope it helps.

//On the Update() function            

if (Input.GetKeyDown(KeyCode.Escape) && !isGamePaused)
            {
                Time.timeScale = 0;
                isGamePaused = true;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) && isGamePaused)
            {
                Time.timeScale = 1;
                isGamePaused = false;
                askToRestart = false;
            }

//On the OnGUI() function 
 private void OnGUI()
    {
        if (isGamePaused && gameStarted)
        {
            if (!askToRestart)
            {
                GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "Pausa");
                if (GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 10, 90, 20), "Restart"))
                {
                    askToRestart = true;
                }
                if (GUI.Button(new Rect(Screen.width / 2 , Screen.height / 2 - 10, 90, 20), "Exit"))
                {
                    Application.Quit();
                }
            }
            if (askToRestart)
            {
                GUI.Box(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 50, 200, 30), "¿Want to restart?");
                if (GUI.Button(new Rect(Screen.width / 2 + 5, Screen.height / 2 - 10, 60, 20), "Si"))
                {                    
                    Application.LoadLevel("GamePlayScene");
                }
                if (GUI.Button(new Rect(Screen.width / 2 -65, Screen.height / 2 - 10, 60, 20), "No"))
                {
                    askToRestart = false;
                }
            }
        }
}