How Do I Show and Hide GUI?

Hi guys.
I am making an In-Game-Notepad so the player can write down notes, and I am trying to make it so that the “Player” can press “n” on his/her keyboard and either Show or Hide the Notepad.

this is the script I have so far…

var notePadText : String="NotePad...";

function OnGUI () {

        notePadText = GUI.TextArea (Rect (5, 5, 200, 300), notePadText, 200);
}

ok so now I wan’t to make it so the player presses a button (on there keyboard) and the notepad shows and hides but I cannot figure out how I can achieve that.

Thank you in advance! -Izzy

Wrap your complete GUI code in an if statement, where you check if a boolean variable is true and then use the key to toggle it.

var GUIEnabled : boolean = false;
var notePadText : String="NotePad...";

function Update () {
    if(Input.GetButtonUp("n")) {
        GUIEnabled = !GUIEnabled;
    }
}

function OnGUI () {
    if(GUIEnabled) {
        notePadText = GUI.TextArea (Rect (5, 5, 200, 300), notePadText, 200);
    }
}

try this video Change Text, and Hide GUI when clicking on button! Unity 5! - YouTube