for i = 120, 0, -1 do
Status.Value = "<b>" .. i .. "</b> left"
task.wait(1)
end
What is Status:
Status is a value in ReplicatedStorage which shows the current announcement or whatever at the top of all the players screens.
Problem:
120 is amount of seconds, but if it will just show the seconds of course as there is no seconds to minutes conversion. I saw some fourms but I wasen’t sure how to set it up, when I did I failed. Any help would help me out.
If it helps to resolve this, the UI that shows the status simply does a while wait() loop for setting the text the value of Status.
function Format(Int)
return string.format("%02i", Int)
end
function convertToHMS(Seconds)
local Minutes = (Seconds - Seconds%60)/60
Seconds = Seconds - Minutes*60
local Hours = (Minutes - Minutes%60)/60
Minutes = Minutes - Hours*60
return Format(Hours)..":"..Format(Minutes)..":"..Format(Seconds)
end
for i = 120, 0, -1 do
Status.Value = "<b>" .. convertToHMS(i) .. "</b> left"
task.wait(1)
end
For future audiences,
I now realize I forgot to provide attribution to where I initially adapted this code from.
Here is the original reply where, I adapted the code from.