display only one random question

private var as_randomQuestion : String = [“my name”,“are u sure”,“hello”];

function randomQuestion()
	var int_random : int = (Random.Range(0, as_randomQuestion.Length));
	return as_randomQuestion[int_random];	

GUI.Label(new Rect((Screen.width - 240)*0.5,(Screen.height*0.1) + 100, 240, 40), randomQuestion());

please help me display only one random question because its continue to show all the array.

As you keep calling the method in OnGUI(), it gets called at least once per frame. You should handle the question picking somewhere else or put a timer or a checker to restrict it.

Don’t you need to specify the return type in javascript ?

Anyway, the random question is picked twice each frame, and as you don’t change the seed (check out how random works on computer to understand what I am saying), you probably have random question going by pairs each frame if you print them. You need to store the question once (on an event, keyboard, button, or Start/Awake functions etc) and then use that variable.