Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I fix this TeleportService issue?

local TS = game:GetService("TeleportService")
local Players = {}

--add players to Players using table.insert()

local code = TS:ReserveServer(game.PlaceId) -- Returns a code
local players = Players:GetPlayers() -- Get a list of all players

TS:TeleportToPrivateServer(4578052378,code,players) -- Actually teleport the players
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen

So I replaced "game.PlaceId" to a another place that has the startplace of the game.PlaceId. However, whenever I try it says "Attempted to teleport to a place that does not exist."

Any suggestions or fixes?

1 answer

✓ Accepted answer

Do not use GetPlayers for this. Getchildren will get all, Get players will not and will only get one player. As well teleporting to another game in studio will not work! you used teleport to private server Which does not exist!

local TS = game:GetService("TeleportService")
local Players = {}

--add players to Players using table.insert()

local code = TS:ReserveServer(game.PlaceId) -- Returns a code
local players = Players:GetChildren() -- Get a list of all players

TS:Teleport(4578052378,players) -- Actually teleport the players
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen

3 comments

0

Does not seem to work still...

0

@tinfoilbotGamer are you putting a correct game ID? like the full game ID and not an item!

0

OOPS! I see the issue. Please copy and paste the new script. you did players and I did player. oops!

This discussion is preserved as it was. New answers, comments, and votes are closed.