I want to achieve a timer that counts down and once it has reached it’s final goal it counts back up again.
My issue is that I cant think of a way that I could make the Countdown count back up once its reached 00:00
I’ve tried solutions such as: Using if statements to detect when it has reached its final goal and then start counting up, I have also tried adding boolean values as well.
local Time = script.Parent.Time
local MaxTime = 5
while wait(1) do
local Minutes = math.floor(MaxTime / 60)
local Seconds = MaxTime - Minutes * 60
Seconds = math.floor(Seconds)
if string.len(Seconds) < 2 then Seconds = "0" .. Seconds end
if string.len(Minutes) < 2 then Minutes = "0" .. Minutes end
local Format = Minutes .. ":" .. Seconds
MaxTime -= 1
Time.Text = "T-"..Format
end
This is my script so far, I used a DevForum post to help me with this Part and then further modified it to work with my needs.
This is it so far:
https://gyazo.com/411c1a6457717c70cddce38729bbe8b2