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

How to teleport all players to a certain location?

Asked by 7 years ago

I tried doing this, even tho it wouldn't work, because I'm calling a nil value, but I couldn't think of anything else.

plr = game.Players:GetPlayers() 

if a ~= nil then 
plr.Character.Torso.CFrame = game.Workspace.Island.t1.CFrame
end

please help

2 answers

Log in to vote
1
Answered by 7 years ago

Try this:

for i,v in pairs(plr) do
    v.Character.Torso.CFrame = game.Workspace.Island.t1.CFrame
end
Ad
Log in to vote
0
Answered by
NeptyU 15
4 years ago

This script works for me:

for i, v in pairs(game.Players:GetChildren()) do
    local Character = game.Workspace[v.Name]
    Character.HumanoidRootPart.Position = Vector3.new(-176, 21.5, -220) --Put the position of where you want them to teleport
end
0
I have not tested it with multiple players yet though so I am not sure if it will teleport all players NeptyU 15 — 4y

Answer this question