Make a Button popup

Hi, I am trying to make a button popup when another button is pressed. If anyone can help I would appreciate it. Thanks
Button1 is created but Button2 does not appear.

Here is my code:

if (GUI.Button( Rect( (Screen.width/2)-200, Screen.height -320, 140, 70), “Button1”))
{
//This doesn’t show up but Button1 does
if(GUI.Button( Rect( (Screen.width/2)-200, Screen.height -520, 140, 70), “Button2”));
{
//I am going to load a scene when Button2 is pressed
}
}

Create a boolean variable with a default value of false, then when button1 is pressed change its value to true. Have the code for button2 inside of an if statement, checking your boolean variable.

Sorry for the late reply. Thanks for the help, I tried to implement what you told me but I still make a second button pop up. Maybe you could show me a couple quick lines? Thanks

This is C#, but its very simple to convert to JS.

using UnityEngine;
using System.Collections;

public class TestMenu : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}


    bool showButton2 = false;
    void OnGUI()
    {
        if (GUI.Button(new Rect(8, 8, 80, 24), "Button 1"))
        {
            showButton2 = !showButton2;
        }

        if (showButton2)
        {
            if (GUI.Button(new Rect(8, 40, 80, 24), "Button 2"))
            {
                //Button 2 does something here.
            }
        }
    }
}

Thanks I appreciate it, I got it working now.