Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Timer
- -- Data:
- local gData {
- SystemIsLoaded = false,
- Timer = GetTimer(),Sec = 0,Minute = 0,Hour = 0
- }
- -- Main function:
- function main()
- -- Convert function:
- Convert = function(n)
- for i = 0,9 do
- if n == i then
- return "0"..n
- end
- end
- return n
- end
- -- Process:
- while true do
- if not SystemIsLoaded then
- while not SystemIsReady() or AreaIsLoading() do
- Wait(0)
- end
- gData.SystemIsLoaded = true
- else
- -- Timer:
- if gData.Timer + 1000 <= GetTimer() then
- gData.Sec = gData.Sec + 1
- if gData.Sec > 60 then
- gData.Sec,gData.Minute = 0,gData.Minute + 1
- if gData.Minute > 59 then
- gData.Minute,gData.Hour = 0,gData.Hour + 1
- end
- end
- end
- -- Print:
- TextPrintString(Convert(gData.Hour)..":"..Convert(gData.Minute)..":"..Convert(gData.Sec),1,1)
- -- Wait:
- Wait(0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment