I set up a system where when you walk into a box it is supposed to teleport you to a secondary place of the game, but when testing it just errored as shown below. I have attached pictures of the error from my developer account, and on an alt. If you would like to test this the game link is this.
This is the teleportation code:
local TpService = game:GetService("TeleportService") local Players = game:GetService("Players"):GetPlayers() local TeamService = game:GetService("Teams") local TeleportService = game:GetService("TeleportService") local timeUntilTp = game.ServerStorage.TimeUntilTeleport local Gui = game.Workspace.HoldingChamber.HoldingChamberSpawn.BillboardGui.TextLabel while wait(1) do if #TeamService.Waiting:GetPlayers() >= 1 then timeUntilTp.Value = 30 wait() for i = timeUntilTp.Value, 1, -1 do timeUntilTp.Value = timeUntilTp.Value - 1 Gui.Text = 'Teleporting in '..tostring(timeUntilTp.Value)..' seconds.' wait(1) end Gui.Text = 'Teleporting soon!' if #TeamService.Waiting:GetPlayers() >= 1 then local rs = TeleportService:ReserveServer(5890026222) local Players = game:GetService("Players"):GetPlayers() local playersToTp = TeamService.Waiting:GetPlayers() TeleportService:TeleportToPrivateServer(game.PlaceId,rs,playersToTp) end end end
Thank you! Any help is greatly appreciated.
You're not teleporting to the other game. Your code is trying to take the player to the same game he/she is in. You should get the secondary place's ID, and use it
TeleportService:TeleportToPrivateServer(5890026222, rs, playersToTP)