else If Statement need assisstance with

I have a script that I am working on. I have a GUI.Box set up with the with 25 openstring descriptions. I want to have it where I can take that script with my slavetooltip script and make it so when I click on a model in my scene, a box pops up with all of the information I need.

Now the problem Im having is that the box is staying in the scene all the time. So when I click on the object, the text is only popping up inside that box whenever I click on an object in my scene.

Here is how it is set up…at the top of the java script, it reads this…

var displaymessage:String;
var openstring:String;
var descStyle:GUIStyle;

Then it has this…

GUI.Box(Rect(Screen.width/2-200,Screen.height -160,400,150),openstring,descStyle);
		switch(displaymessage){
			case "Ninja Knife": openstring="Description: One of the most deadliest weapons for combat.\n\nFunction: It slices and dices the enemy. Very Sharp Blades.
break;

default : openstring="";
break;
		}

This is in my main script for the current scene, and then I have that custom slavetooltip that I used for each model so that the information will pop up once clicked.

But I know I would ahve to use an ElseIf statement right? But I dont know where to put it, or how to write it

I’m not sure I understand, but I think you’re missing the code to either show or hide the box (i.e.: a GUI.Button).

You would use a GUI.Button make it appear.

Then, to make it hide, you can either do it by time (saving the Time.time when the box appeared and then check until X amount of seconds have passed), or when another button is clicked.

Regarding your else if, I’m not sure where you need it. Since you’re using a switch statement, you should add another “case” sentence if you need more options.

I hope this helps…