Menu script HELP NEEDED

Hi guys,
I tryed to make a menu script ( its a C# Script ), and it seems it got some problems :face_with_spiral_eyes:
This is the script:

using UnityEngine;
using System.Collections;

public class MenuManager : MonoBehaviour 
{
    public string CurrentMenu;
	
	public string MatchName = "";
	public string MatchPassword = "";
	public int MatchMaxPlayers = 32;
	
	void Start()
    {
		CurrentMenu = "Main";
	}
	
	void OnGUI()
	{
		if(CurrentMenu == "Main")
			Menu_Main();
		if(CurrentMenu == "Lobby")
			Menu_Lobby();
		if(CurrentMenu == "Host")
			Menu_HostGame();
	}
    
	public void NavigateTo(string nextmenu)
	{
		CurrentMenu = nextmenu;
	}
	
	private void Menu_Main()
    {
	    if(GUI.Button(new Rect(10, 10, 200, 50), "Host Game"))
		{
			NavigateTo("Host");
		}
	}
	
	private void Menu_HostGame()
    {
		//Buttons of 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"))
		{
			
		}
		
		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, 10, 200, 30), MatchPassword, "");
		
		GUI.Label(new Rect(220, 90, 130, 30), "Match Max Players");
		string maxuser = GUI.TextField(new Rect(400, 90, 200, 30), MatchMaxPlayers.ToString());
		MatchMaxPlayers = int.Parse(maxuser);
		MatchMaxPlayers = Mathf.Clamp(MatchMaxPlayers, 8, 32);
	}
	
	private void Menu_Lobby()
    {
		
	}
}

Problems:
1: Argument #3 cannot convert string expression type to ‘char’
2: error CS1502: The best overloaded method match for `UnityEngine.GUI.PasswordField(UnityEngine.Rect, string, char)’ has some invalid arguments

Does anyone know how to fix this?
OfficialRemixGames said it should work now, but for me it doesn’t:(

The char value near the end of the parentheses is how many letters are allowed in the field. You have it set to " ".
Just set it to something like 25 and you should be set. Also before that value add “*”[0] to turn the password field into stars(optional)

so matchPassword = GUI.PasswordField(new Rect(400, 10,200,30), MatchPassword,“*”[0],25);

Hope this helps!

Ok, it works now :slight_smile: Thanks
But now i got another problem:

Assets/Scripts/MultiplayerManager.cs(68,25): error CS0029: Cannot implicitly convert type `UnityEngine.NetworkPlayer' to `bool'

What does that mean, and how do i fixt this?:face_with_spiral_eyes:

I have no idea, that relates to another script

Go over the script, what i understand is that you are using a network player as a boolean var somewhere.

1.Assets/Scripts/MultiplayerManager.cs(68,25): error CS0029: Cannot implicitly convert type `UnityEngine.NetworkPla’ tl’

Cannot convert .NetworkPlayer to bool