I would like to know how I can teleport all players to one location after a certain time limit has passed (like a mini game round)
Thanks in advance!
I would like to know how I can teleport all players to one location after a certain time limit has passed (like a mini game round)
Thanks in advance!
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.
1 comment
Scripting Helpers is not a request site. Please review this article and take it into consideration the next time you're about to ask a question. https://scriptinghelpers.org/blog/posting-good-questions-and-answers-on-scripting-helpers