I want to make a game with matchmaking. So I thought I will need ReserveServer and TeleportToPrivateServer. However, I have no idea how it works. Can someone explain it for me with some code if possible
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") local code = TS:ReserveServer(game.PlaceId) -- Returns a code TS:TeleportToPrivateServer(game.PlaceId,code,game.Players.username) -- Actually teleport the players -- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen
Here is a edited example from the roblox wiki, basicly you reserve the server with local code = ReserveServer(game.PlaceId)
That returns a code so you should teleport with TeleportToPrivateServer(game.PlaceId,code,game.Players.username
(and replace username with the players username of course). So overall when you reserve a server it returns a code that you teleport to it via teleporttoprivateserver. If this solved your question be sure to mark this answer with the checkmark!