Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Military Clock Converter
- -- By: Memo1332 / Poison Test
- seconds = 0 -- Initial Variables
- minutes = 0
- hours = 0
- days = 0
- while seconds >= 60 do -- There are 60 seconds in a minute, so while seconds is greater
- seconds = seconds - 60 -- than 60 it will continously take away 60 values from seconds and add
- minutes = minutes + 1 -- 1 value to minutes
- end
- while minutes >= 60 do -- Same thing as the previous function, just with different variables
- minutes = minutes - 60
- hours = hours + 1
- end
- while hours >= 24 do -- There are 24 hours in one day, so while hours is greater
- hours = hours - 24 -- than 24 it will continously take away 24 values from hours and add
- days = days + 1 -- 1 value to days
- end
- --[[
- This would be an area to put any of your scripts in
- the line of strings is not an area to pass or add things
- to if you do not know what you're doing, anything added in
- that is passed the line of strings potentially can error
- --]]
- --------------------------- Line Of Strings
- if seconds == 0 then seconds = "00" end -- If any variable is 0 it will be changed into a string so the
- if minutes == 0 then minutes = "00" end -- clock looks nicer and my ocd says it's okay.
- if hours == 0 then hours = "00" end
- if days == 0 then days = "00" end
- print(days..":"..hours..":"..minutes..":"..seconds) -- Every value combined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement