UNSOLVED How do I teleport all players in a server to a different game?

I am trying to get all the players from one server to go to a second part of the game in a different experience kind of like a story game to a game like the mimic. My script works fine other then the fact that it teleports each person to the game but in different servers.

for i, v in pairs(Players:GetChildren()) do
TeleportService:Teleport(000, v) – 000 is game ID
end

thanks everyone!

Try teleporting to a reserved server:

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

local code = TeleportService:ReserveServer(game.PlaceId)

local players = Players:GetPlayers()

TeleportService:TeleportToPrivateServer(game.PlaceId, code, players)
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen

Reference:
https://create.roblox.com/docs/reference/engine/classes/TeleportService#ReserveServer

2 Likes

Ill be right back im gonna test it out.

this did not work am I missing something?

Try using a teleport party (TeleportService:TeleportPartyAsync). I can’t give an example on mobile right now, but it’s on the creator documentation.

If it should be a private server, you can use :ReserveServer too.

2 Likes

do i put the games Id in code?

The placeId.

Did you see rc8s response? That might be a better method.

2 Likes