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

How would I get all players?

Asked by 8 years ago

If I did a teleportion script how would I get all the players to telport not just 1 person to telport

1 answer

Log in to vote
-2
Answered by 8 years ago

Well first you would do a for statment such as

for i,v

then you would get all players.

for i,v (game.Players:GetChildren()) do

now you get their character and teleport them :D like...

v.Character:MoveTo(Vector3.new(INSERT CORDNATES HERE!))

or you could make it so that they all teleport to a part..

v.Character:MoveTo(Vector3.new(game.Workspace.Part.Position))

full code:

            for i,v in pairs (game.Players:GetPlayers()) do
                v.Character:MovTeTo(Vector3.new(INSERT CORDNATES HERE!))

hope this helped!

Ad

Answer this question