Advertisement
HowToRoblox

TimeHandler

Apr 10th, 2020
2,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. while wait() do
  2.  
  3.  
  4.     local t = tick()
  5.            
  6.            
  7.     local sec = math.floor(t % 60)
  8.            
  9.     local min = math.floor((t/60)% 60)
  10.            
  11.     local hour = math.floor((t/3600)% 24)
  12.            
  13.            
  14.     if string.len(sec) < 2 then sec = "0" .. tostring(sec) end
  15.            
  16.     if string.len(min) < 2 then min = "0" .. tostring(min) end
  17.            
  18.     if string.len(hour) < 2 then hour = "0" .. tostring(hour) end
  19.            
  20.            
  21.     script.Parent.DigitalTime.Text = hour .. ":" .. min .. ":" .. sec
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement