How to make an online server.

I am making a fishing game where you can battle against each other online. but I dont know how to join a server and how to make a server please help.

this is my code till now:

#pragma strict

MasterServer.ipAddress = "127.0.0.1";

var remoteIPadress = "192.168.0.13";
var remotePort = "";
var listenPort = "";

var useNat = true;

var myIP = "";
var myPort = "";

var MaxPlayers = 10;



function Start () {

  //PlayerScript = GameObject.Find("spritenaorobot(Clone)").GetComponent(OnTriggerEnter);

}
function OnConnectedToServer()
    {
    
    Debug.Log("Server connect");
     GameObject.Find("Cube").transform.position.x = -5;   
    }

function OnServerInitialized()
	{
		Debug.Log("Server Initializied");
		GameObject.Find("Cube").transform.position.x = 0;
	}
	
	
	function RefreshHostList()
	{					    //typename
	MasterServer.RequestHostList("Uniquegamename");
	
	}
	
function OnGUI ()
{//sort of Starting server

if(Network.peerType == NetworkPeerType.Disconnected){}

if(GUI.Button(Rect(5,5,80,30),"Connect")){

Network.useNat = useNat;
Network.Connect(remoteIPadress, remotePort);

}
if(GUI.Button(Rect(5,40,80,30),"Startserver")){


Network.useNat = useNat;
Network.InitializeServer(MaxPlayers, 25000);

}

remoteIPadress = GUI.TextField(Rect(5,100,120,30),remoteIPadress);


}

i am 14 years old so it could be a dumb question.

greetings Paul
PS:I am dutch so i could have made some mistakes in spelling.

Maybe this could help: How to create an online multiplayer game with Unity - Paladin Studios

Btw, I’m also dutch (Belgian) and 14 years old. :slight_smile:

hoi