Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lua Timer
--[[ This program will attempt to make a timer Author: Ice Scripter How to use the program: use the "get_remaining_time" function and put your time that you would like to count down to in the "()" Default time is set to 1559148288 + 604800 ]]-- local countdown_time = 1559148288 + 604800 -- Time it counts down from -- local time_math -- Creating a nil variable for future use local function get_remaining_time(x) if x ~= nil then -- if x isn't nil it will replate time_math with x - os.time() -- time_math = x - os.time() else time_math = countdown_time - os.time() end print("Getting remaining time...") if countdown_time > os.time() then return math.floor (time_math /60 /60 /24 %7) .. ":" .. math.floor (time_math /60 /60 %24) .. ":".. math.floor (time_math /60 % 60) .. ":" .. math.floor (time_math %60) -- Returns this if time is still remaining. -- else return "Countdown complete." -- Returns this when the countdown is completed -- end end print(get_remaining_time().."\n") -- prints the time left -- print("Current time in seconds: ".. os.time().. "\nCount down time: "..countdown_time) -- Prints the current time and countdown time (in seconds) --
run
|
edit
|
history
|
help
1
If you have any questions just ask me! :D
by Ice Scripter, 1 years ago
Please
log in
to post a comment.
Truly random numbers (Lua)
test random skill id
Area of Sector Calculator
Uppercase
Creating habits v3, Lua
Random number generation with ranges (Lua)
Monty Hall Problem Simulated
Creating habits v2, Lua (WIP)
Map generator
ROBLOX Ui Play Button
If you have any questions just ask me! :D
by Ice Scripter, 1 years agoPlease log in to post a comment.