Hiya Developers!
I have a script here, which is meant to check what map is selected, and teleport the players to the location accordingly to the map. But, i have an issues. When 2+ players are playing, it teleports each player 1 at a time with about a 1/2 second interval.
The intended function is that, the script TP’s all players in one group?
Any ideas?
local players = game.Players:GetChildren()
if map.Name == "Placeholder" then
description.Value = "Placeholder"
for i = 1,#players do
if players[i].Character ~= nil then
task.wait(3)
local plrs = game.Players:GetChildren()
for i = 1,#plrs do
end
local num = math.random(1,32)
plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position)
plrs[i].Character.Parent = workspace.Ingame
print("Teleport Finished")
end
end
end
if map.Name == "Placeholder2" then
description.Value = "Placeholder"
for i = 1,#players do
if players[i].Character ~= nil then
task.wait(3)
local plrs = game.Players:GetChildren()
for i = 1,#plrs do
end
local num = math.random(1,32)
plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position)
plrs[i].Character.Parent = workspace.Ingame
print("Teleport Finished")
end
end
end
Help is appreciated!
