Advertisement
xmaanzach

Clock UI #1

Dec 9th, 2018
3,201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. local Lighting = game:GetService("Lighting")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local Event = ReplicatedStorage.TimeChanged
  4.  
  5. while wait(1) do
  6. local Hours = math.floor(Lighting:GetMinutesAfterMidnight() / 60)
  7. local AM = " AM"
  8. local Minutes = Lighting:GetMinutesAfterMidnight() - Hours * 60
  9.  
  10. if Hours > 12 then
  11. Hours = Hours - 12
  12. AM = " PM"
  13. end
  14.  
  15. if Hours == 0 then
  16. Hours = 12
  17. end
  18.  
  19. if Minutes < 10 then
  20. Minutes = "0".. Minutes
  21. end
  22.  
  23. local text = Hours..":"..Minutes.. AM
  24. Event:FireAllClients(text)
  25. Lighting:SetMinutesAfterMidnight(Lighting:GetMinutesAfterMidnight() + 1)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement