So im making a lobby that teleports players into the actual game and when it reaches 0 and im in the queue it shows this:
Line 50 is the line after the for i,v in pairs loop for PassengerTable:
--Function Countdown
function countdown()
timerLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
CanEnter = true
for i = 30, 0, -1 do
timer.Value = i
--Red Text
if timer.Value < 10 then
timerLabel.TextColor3 = Color3.fromRGB(255, 20, 60)
end
--Disables leaving
if timer.Value < 3 then
CanEnter = false
for i,v in pairs(PassengerTable) do
LeavePlane:FireClient(v)
end
end
wait(1)
end
if passengers.Value == 0 then
wait(1.5)
countdown()
CanEnter = true
end
timerLabel.Text = "Boarding Plane.."
local reservedServer = TeleportService:ReserveServer(7936258099)
for i, v in pairs(PassengerTable) do
TeleportService:TeleportToPrivateServer(7936258099, reservedServer, v, passengers.Value)
end
table.clear(PassengerTable)
countdown()
end