How do i merge these things?

Hey, everyone! i’m working on a talking system, for a tutorial level.
The aim is to activate the GUI elements in the script when you touch a cube with is trigger on. the script however right now, consists of two parts that need to be one: the part where the trigger outputs an action, and the part with the actual GUI:

public var text = "box text here";
public var NPCname = "NPC name here";

	function OnTriggerEnter (other : Collider) {
		print ("Test");
		
	}
	
function Start () {



}
	function OnGUI() {
		 GUI.Box(Rect(Screen.width / 6,Screen.height / 1.3,Screen.width / 1.5,Screen.height / 4),"Test 2");

	}

Now, the first part makes the log print Test, that works fine, so we’ve got a working trigger. the second part is the setup for the GUI itself. my question is, what string of code allows me to have the trigger activate the GUI?

I strongly advice you do some tutorials to get the basics of programming, and learn what kinds of commands and variables are available to use.

Use a boolean that changes state based on if an object is in the trigger zone

var inTriggerZone : boolean = false;

function OnTriggerEnter (other : Collider) {
	inTriggerZone = true;
}

function OnTriggerExit (other : Collider) {
	inTriggerZone = false;
}

function OnGUI() {
	if ( inTriggerZone ) // this is the same as writing if(inTriggerZone==true)
	{
		GUI.Box(Rect(Screen.width / 6,Screen.height / 1.3,Screen.width / 1.5,Screen.height / 4),"Test 2");
	}
}