Displaying Text Once

I am trying to displaying an entrance text but I want it to get displayed only once when I am entering into one of my buildings. But as I am using a box collider, it still displays the same text when I am leaving the building. Here’s the scripts that I am using. Thanks

Btw both scripts are placed on the box collider right now.

WelcomeMCScript:

var close = false;
var textFieldString = "text field";
var customSkin : GUISkin;
//var MCGUI : GUIText;
//var guiTexture: GUITexture;
var fadeSpeed : float = 2;
var isPlaying : boolean;


function SetTheGUI () {
    close = true;
	isPlaying  = true;
}

function UnSetGUI () {
    close = false;
	isPlaying = true;
}

function OnGUI () {
    if (close) {
		GUI.skin = customSkin;
		//GUITexture = guiTexture;
        GUI.Label (Rect (900, 300, 100, 40), textFieldString);
		//GUI.Label (Rect (25, 25, 100, 30), textFieldString);
		isPlaying = false;
    }
}

WelcomeMCScriptTrigger:
function OnTriggerEnter(other : Collider)
{
  if (other.tag == "Player")
  {
	SendMessageUpwards("SetTheGUI");
  }
}

function OnTriggerExit (other : Collider)
{
  if (other.tag == "Player")
  {
   SendMessageUpwards("UnSetGUI");
  }
}

Since it enters the trigger two times (first when the player enterrs the building and the second when he leaves), you can use a private boolean variable “isInside” (default false) that you set to its opposite in your OnTriggerEnter and so display the text only if it is true.

Hello ZioRed, So what you are saying is something like this ?

var close = false;
var textFieldString = "text field";
var customSkin : GUISkin;
//var MCGUI : GUIText;
//var guiTexture: GUITexture;
var fadeSpeed : float = 2;
var isInside : boolean;

function SetTheGUI () {
    close = true;
	isInside = false;
}

function UnSetGUI () {
    close = false;
	isInside = false;
}

function OnGUI () {
    if (close) {
		GUI.skin = customSkin;
		//GUITexture = guiTexture;
        GUI.Label (Rect (900, 300, 100, 40), textFieldString);
		//GUI.Label (Rect (25, 25, 100, 30), textFieldString);
		isInside = true;
    }
}

Please guys anymore ideas ??

Please guys I need some help