Advertisement
PlayStationUser99

TextFunction

May 23rd, 2023
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local Timer = 0
  2.  
  3. function TimerText()
  4.     local Miliseconds:string = tostring((Timer - math.floor(Timer)) * 1000)
  5.     local Seconds:string = tostring(math.floor(Timer%60))
  6.     local Minutes:string = tostring(math.floor(Timer/60))
  7.    
  8.     if #Miliseconds == 1 then Miliseconds = "0"..Miliseconds end
  9.     if #Seconds == 1 then Seconds = "0"..Seconds end
  10.     if #Minutes == 1 then Minutes = "0"..Minutes end
  11.    
  12.     local Final:string =
  13.     Minutes..":"..
  14.     Seconds.."."..
  15.     string.sub(Miliseconds, 1, 2)
  16.    
  17.     return Final
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement