I have this script here as practice with coroutines, but it doesn't seem to work. Am I right that it has something to do with the if statement?
local down = coroutine.wrap(function()
time_left = script.countdown.Value--value is 900.
while true do
time_left = time_left - 1
wait(1)
print(time_left)
end
end)
down()
local stop = coroutine.wrap(function()
if script.countdown.Value == 890 then--890 for testing
script.countdown.Value = 900
end
end)
stop()

3 comments
Why are you using two coroutines for this? You shouldn't need one at all
Wouldn't it just keep going forever? And I want it to be two different scripts so I can apply it to what I'm working on
coroutine.resume(down) and you'd need a while loop in the stop also, HOWEVER, I recommend a .Changed event to be called on script.countdown