I have this countdown function for a racing game of mine. I was wondering how I could check (during a 120 second countdown) if a variable called raceInProgress was set to false to then stop the countdown.
function countdown(num, prefix)
for i = 0, num do
wait(1)
if prefix then
announce(prefix .. num - i)
else
announce(num - i)
end
end
end
How would I go about stopping this countdown early?