My GUI Text Pop Up Script

var player : GameObject;
private var bool : boolean;

function OnTriggerEnter(other : Collider) {
if(other.tag == “Player”) {
bool = true;
}
}

function OnGUI(){
if(bool == true) {
if(GUI.Button (Rect (100, 100, 500, 40), “Message goes here Click to close”)) {
Debug.Log(“Door Works!”);
bool = false;

}
}

}
Destroy (gameObject, 5);

The last piece of coding, "Destroy (gameObject, 5); the 5 represents the fade out time too basically, since you are attatching this script to a gameObject with a box collider and upon triggering the collider, the script is activated and this comes up. The script then destroys the block and the message disappears too, so use the seconds as a fade out timer more than anything.

SCRIPT UPDATED*

var player : GameObject;
private var bool : boolean;

function OnTriggerEnter(other : Collider) {
if(other.tag == “Player”) {
bool = true;
}
}

function OnGUI(){
if(bool == true) {
if(GUI.Button (Rect (550, 750, 150, 50), “What is this?”)) {
bool = false;

}
}

}

yield WaitForSeconds (5);
Destroy (gameObject, 6);

Please read this: http://forum.unity3d.com/threads/143875-Using-code-tags-properly…