Multiplayer needs a lot of infrastructure to work correctly. Instead of writing it from scratch, it's much more efficient to just use infrastructure built by others and let them handle all the hard work. This tutorial is on how to make any Multiplayer Game runnable on Gotm. This won't explain how to make a Multiplayer Game from the ground up, just how to adjust it once it's done. Feel free to follow tutorials from others such as from Gamefromscratch or GDQuest to learn how to do that. There are two main distinction with how Multiplayer runs on Gotm: with a custom link and without a custom link.
Custom links are generated whenever you try to host a server on their website. As a very basic explanation, this link creates a VPN that lets your players connect to each other as a local network. But thats not important to know. The point is, you can now run Multiplayer Games with the "127.0.0.1" ip in the browser.
Have the client use the "127.0.0.1" ip.
2. Have the host give an invitation link to the second player to be a client. The link will appear in the bottom-right corner when you try to host a server.
3. Make sure the client player uses the link to join the server.
If you don't know the player personally, it may be hard to give them the custom link. In this case, you should use the Gotm plugin that lets you access their API directly from GDScript. One of the functionality of the API is to create a lobby where players can connect to. You can get the plugin from the AssetLib or from Github. Add the "Gotm.gd" script as an autoload, name it "Gotm". With this, you can get it running on the browser with extra functionality with just a few lines of code.
Host a lobby. The boolean passed through suppresses the invitation link. After hosting it, make it fetchable by making it not hidden. You can also give the lobby a name but that's optional.
2. Once you're hosting a lobby, create a server.
Fetch all the current lobby in the form of an array, it may take 1-5 seconds to find a recently created lobby. This only fetches it once so add a functionality to fetch them again with either a refresh button or periodically check for new lobbies.
2. Join a selected lobby from the array. You can create a lobby browser with an ItemList if you prefer or simply join the first in the list.
3. Once you're in a lobby, create a client with the host's ip address which you can get with from a property of the lobby.
Once you're done with the changes, you can now host your game on Gotm at gotm.io. You will need to create an account and a Studio before hand but after that's done, follow this tutorial and you should be fine. If you need extra documentation for the plugin, you can find it on their website here.