I'm trying to make a game where when any player stands in a certain location they all get teleported after a period of time. I have the teleportation script already, but I don't know how to make the queue part.
local MapSelect = script.Parent.MapSelect
local time = 30
local NumberOfMaps = script.Parent.NumberOfMaps.Value
while true do
repeat wait() until
script.Parent.time.Value == 0
MapSelect.Value = math.random(1,NumberOfMaps)
local player = game.Players:GetPlayers()
if MapSelect.Value == 1 then
for i = 1, #player do
player[i].Character:MoveTo(game.Workspace.Part1.Position)
script.Parent.time.Value = 3
end
end
if MapSelect.Value == 2 then
for i = 1, #player do
player[i].Character:MoveTo(game.Workspace.Part2.Position)
script.Parent.time.Value = 3
end
end
if MapSelect.Value == 3 then
for i = 1, #player do
player[i].Character:MoveTo(game.Workspace.Part3.Position)
script.Parent.time.Value = 3
end
end
end

5 comments
Queue?
By that do you mean teleport players at different times?
Those who are confused, I want to make the queue sort of like those games when you stand in a box and when the timer runs out all the players get teleported
So you want to tp players after a certain amount of time?
Edited the post for clarification