Format Exception: Input String Was Not in the Correct Format

sorry if this has been asked before but I’m having a really annoying problem occuring. which states:

“FormatException: Input string was not in the correct format
System.Int32.Parse (System.String s) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Int32.cs:629)
MenuManager.Menu_HostGame () (at Assets/Scenes/Scripts/MenuManager.cs:62)
MenuManager.OnGUI () (at Assets/Scenes/Scripts/MenuManager.cs:24)”

Here is my code:

//Buttons Host Game
		if(GUI.Button(new Rect(10,10,200,50), "Back"))
		{
			NavigateTo("Main");
		}
		
		if(GUI.Button(new Rect(10,60,200,50), "Start Server"))
		{
			MultiplayerManager.instance.StartServer(MatchName,MatchPassword,MatchMaxPlayers);
		}
	
		GUI.Label(new Rect(220,10,130,30), "Match Name");
		MatchName = GUI.TextField(new Rect(400,10,200,30),MatchName);
		
		GUI.Label(new Rect(220,50,130,30), "Match Password");
		MatchPassword = GUI.PasswordField(new Rect(400,50,200,30), MatchPassword, '*');
		
		GUI.Label(new Rect(220,90,130,30), "Match Max Players");
		GUI.Label(new Rect(400,90,200,30),MatchMaxPlayers.ToString());
		MatchMaxPlayers = Mathf.Clamp (MatchMaxPlayers,8,32);
		
		if(GUI.Button(new Rect(425,90,25,30), "+"))
			MatchMaxPlayers += 2;
		if(GUI.Button(new Rect(450,90,25,30), "-"))
			MatchMaxPlayers -= 2;
		} 

		
	private void Menu_Lobby()
	{
			
	}
}

I had a fiddle with it and it gave me another error…

NullReferenceException: Object reference not set to an instance of an object
MenuManager.Menu_Main () (at Assets/Scenes/Scripts/MenuManager.cs:41)
MenuManager.OnGUI () (at Assets/Scenes/Scripts/MenuManager.cs:20)

heres is are the lines of code they are coming from…

Line 41

MultiplayerManager.instance.PlayerName = GUI.TextField(new Rect(400,10,200,30),MultiplayerManager.instance.PlayerName);

Line 20

Menu_Main();

Hope that helps, sorry I fiddled around with it while waiting for an answer :confused: