local TimeWait = script.TimeWait
local reset = script.Reset
while wait() do
if TimeWait.Value == 0 and reset.Value == false then
TimeWait.Value = 10
reset.Value = true
elseif reset.Value == false then
TimeWait.Value = TimeWait.Value -1
print(TimeWait.Value)
wait(1)
end
end
Your second IF statement isn’t passing. You set reset.Value as True in first IF statement, script sees that it doesn’t pass first IF, tries to pass second IF but doesn’t pass too since reset.Value is True, while it requires False. Basically after first loop it never passes any IF, so it does nothing after it.
Also, I won’t recommend using wait() in a while loop. Instead of it use game:GetService(“RunService”).Stepped:Wait() for server script and game:GetService(“RunService”).Heartbeat:Wait() for local script.
while wait() do
if TimeWait.Value == 0 and reset.Value == false then
TimeWait.Value = 10
reset.Value = true
elseif reset.Value == true then
TimeWait.Value = TimeWait.Value -1
print(TimeWait.Value)
if TimeWait.Value == 0 then reset.Value = false end
wait(1)
end
end
but the value is basically on true so that the countdown isnt starting. If the countdown is 0 the countdown shoudl stop because then i made the reset value. So the value needs to be true at the end
while true do
for i = 10,1,-1 do
print(i)
wait(1)
end
reset.Fire()
end
here’s the full script. i know that here it assumes that reset is an event. this is because if you try to set the value of it, it will immidiately need to get reset back to the opposite state. Assuming that you’ve bound the other scripts to a propertychanged event, that should work. but it’s inefficient.
If you change it to an event it will work better, though if you want to have an intermission like those in minigame games, you can do this:
-----------------For the minigame/round start------------
while true do
for i = 10,1,-1 do
print(i," RoundTimer")
wait(1)
end
reset.Value = true
-----------------For the intermission------------
for i = 10,1,-1 do
print(i," Intermission")
wait(1)
end
reset.Value = false
end