hello, ive been trying to make while true do stop but it wont work, ive already went through fourms but nothing worked, is there anyway to fix this?
local playerService = game:GetService("Players")
local RunService = game:GetService("RunService").Heartbeat:Connect(function()
end)
local players = {}
local Rep = game:GetService("ReplicatedStorage")
local Timer = Rep.Value
task.spawn(function()
print("IntermissionHandler started.")
while true do
players = playerService:GetPlayers()
if #players>1 then
print("Enough players, starting intermission.")
Rep.Values.RoundStatus.Value = "Intermission:"
repeat
task.wait(1)
Timer.Value = Timer.Value - 1
wait()
until Timer == 0
return
else
task.wait(4)
print("Waiting for more players...")
end
end
end)
Rep.Values.RoundStatus.Value = "Round in progress..."