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()
You don't need courtliness... Unless you want to run a function at the same time, however this is a simple script that is better... In my opinion hope it helped!
local time = 900 function countdown() for i = 1,900 do wait(1) time = time-1 print(time) end --What to do after that countdown is over end countdown()