Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Teleport everyone in my game to another game using TeleportService?

Asked by 10 years ago
local Teleport = game:GetService('TeleportService') -- Get Teleport Service
function teleport(Teleport)
    Teleport.CustomizedTeleportUI = true
    for l,y in pairs(Teleport:GetChildren()) do
        o(y)
        if Teleport:IsA("Player")
            then
            game:GetService('TeleportService'):Teleport(IdHere) -- Place Id specified 
        end
    end
end
teleport()

I want to teleport everyone who is a Player to another game without prompt hence why I used CustomizedTeleportUI because it does not prompt if I use it. But when I tested the script it does not work, some feedback would be very nice

1 answer

Log in to vote
0
Answered by
Mr1Vgy 30
10 years ago

I would do:

local id = 000000 --change this to the teleport place id
for i, v in pairs(game.Players:GetChildren()) do
game:GetService("TeleportService"):Teleport(id)
end
Ad

Answer this question