i was making a countdown for my intermission and its stuck at 14
local MapsFolder = game.ReplicatedStorage:WaitForChild("Maps") local Status = game.ReplicatedStorage:WaitForChild("Status")
while true do Status.Value = "Intermission 15" local interTime = 15 repeat wait() wait(1) interTime = interTime - 1 Status.Value = "Intermission "..interTime until interTime <= 0 wait (2) end
Put the Status.Value = "Intermission 15"
and local Intertime = 15
outside of the forloop and you should be good.
while true do wait(1) Status.Value = "Intermission" ..interTime if interTime ~= 0 then interTime = interTime - 1 end else break; end
local MapsFolder = game.ReplicatedStorage:WaitForChild("Maps") local Status = game.ReplicatedStorage:WaitForChild("Status") local intermissionTime = 15 local startTime while true do startTime = tick() Status.Value = "Intermission 15" repeat local timeSinceStart = math.floor(tick() - startTime) Status.Value = "Intermission " .. intermissionTime - timeSinceStart wait(1) until intermissionTime - timeSinceStart <= 0 wait(2) end
for timers/countdowns, I do not recommend using a while loop. Use a for loop instead. I'm assuming your status is a string value.
local status = game:GetService("ReplicatedStorage"):WaitForChild("Status") local Timer = 15 for i = Timer, 1, -1 do --This just countdowns down by 1 second print(i) Status.Value = "Intermission: "..i.." seconds left" wait(1) end
If you want it to keep going on forever, then put a while wait() do
at the top. (You can use a while true do, however, it may crash your script or studio.)