How To Make A Minute Form Timer

Hey there!

I was wondering how I would make a timer that countsdown from a certain time. I want the timer to have a “:” What I mean by this is instead of counting down, 100, 99, 98, 97, etc. I want it so that it countsdown in minute form such as: 1:00, 0:59, 0:58, 0:57 and so on. I want the script to be short and simple.

Thanks,

Script for normal countdown:

for i = 100, 0, -1 do
       wait(1)
       print(i)
end
7 Likes
3 Likes
local function toMS(s)
	return string.format("%02i:%02i", s/60%60, s%60)
end

for i = 100, 0, -1 do
       print(toMS(i))
       wait(1)
end

The function just converts seconds into the M:S format.

8 Likes

Okay, ill try it and see if it works!

1 Like

I know there are many ways to do this but for my situation, this worked the best. Thanks!

1 Like