hi there, I am trying to change the seconds of timing in my game to turn it to use minute instead. currently it look like this.
here is the code
local GameLength = 300 while true do for i = GameLength, 0, -1 do Status.Value = "There are "..i.." seconds remaining" wait(1) end end
now my question is how to turn it to use minutes instead of second. like this screenshot.
any help would be appreciated. thanks
Simply calculate the minutes and seconds using the current time (i) with
local minutes = math.floor(i / 60) local seconds = i - (minutes * 60)
math.floor returns the number rounded down to the nearest integer
Revised Server Script
local GameLength = 300 while true do for i = GameLength, 0, -1 do local minutes = math.floor(i / 60) local seconds = i - (minutes * 60) Status.Value = (minutes..":"..seconds) wait(1) end end