Function in variable (UnityScript)

Hi, I need to call different function when buttons on my GUI are pressed.

var currentMenu;

function MainMenu(){
  //Print Main Menu
}

function SettingsMenu(){
  //Print Settings Menu
}

//Some More Menues

function Start(){
  currentMenu = MainMenu;
}

function OnGUI(){
  currentMenu();
}

Is there a way to do this? The code above doesn’t work. Thanks for any suggestions!

Is this any use for you?

var MainMenu:boolean = true;
var SettingsMenu:boolean = false;
//var OtherMenus:boolean = false;

function OnGUI(){
	if(MainMenu){
		if(GUI.Button(Rect(Screen.width/2 - 150, 290, 300, 30), "Settings")){
			MainMenu = false;
			SettingsMenu = true;
			// OtherMenus = false;
		}
	}
	if(SettingsMenu){
		//Print Settings Menu
	}
	if(OtherMenus){
		//Print Other Menus
	}
}