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

How can I set teleport all players after a time limit has been passed?

1 answer

You may do it a little different, but here's what I would do. Step 1 Insert two teams. "Lobby" and "Ingame" Step 2 Insert a Server Script

local players = game.Players:GetPlayers()
local gametime = 120 --How long the rounds will take

while wait(30) do
for i = 1, #players do
players[i].TeamColor = BrickColor.new('Bright red') --Or whatever your ingame color is.
players[i].Character.Humanoid.Health = 0
end
wait(gametime)
for i = 1, #players do
players[i].TeamColor = BrickColor.new('Bright blue') --Your lobby team color.
players[i].Character.Humanoid.Health = 0
end
end

To teleport them though, I would do this:

local players = game.Players:GetPlayers()

for i = 1, #players do
players[i].Character.Torso.CFrame = CFrame.new(math.random(1,5),math.random(1,5),math.random(1,5)) -- So the players won't all get stuck together.
end

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