I have a game and a queue script. I want the script to teleport players into one of the games that is part of the start place, but I want everyone who's in the same queue to go to the same server. I have the basic teleport code but I'm not sure how to reserve a server for a separate game. I have seen it in games like "Camping" and, "House Party" so I know that it's possible.
Here is the code
if player_count == 4 then print('teleporting') local queue1 = game.ReplicatedStorage.queue1:GetChildren() local TS = game:GetService("TeleportService") for i,v in pairs(queue1) do local plr = game.Players:WaitForChild(v.Name) TS:Teleport(3350448651,plr)
Assuming you create a table with the players you want to teleport you can use ReservedServers to create a personal server for just this group of players.
local TS = game:GetService("TeleportService") local players= {} --add players to Players using table.insert() local code = TS:ReserveServer(game.PlaceId) -- Returns a code TS:TeleportToPrivateServer(game.PlaceId,code,players) -- Actually teleport the players -- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen