Hi im tunnells i need help making a live event timer. Which includes Days Hours and minutes and seconds until a event starts. My discord is Tunnells:purple_heart:
#2098 If you want to contact me. Or i could pay for a full version of it. Thanks!
for i = 30,0,-1 do
label.Text = i
end
But i want it to include it saving, Days, Seconds etc
I will try my best to explain it.
First you will need to get the time… local date = os.date("*t", os.time())
now you will need to make a table stating when the event should start, example below:
local LiveEvent = {Year = 2020, Month = 11, Day = 22, Hour = 12, Minute = 0, Second = 0}
Afterwards you will need to make an if statement,
so for everything in the LiveEvent table, you will need to check if date.THING
is bigger or equal to LiveEvent.THING
. An example is below:
if date.year >= LiveEvent.Year -- and so on
O but what im trying to do is i have the live event its starting on 9/19/20 at 10:30 am I need a timer that counts down
I don’t see why you need me to respond with how you do that…
You change the the LiveEvent data.
Did you want the timer to use the user’s local time or did you want it locked to one timezone?
Locked timezone UTC
You said you’ll pay for a live event timer? I’ll make one for you and we can negotiate prices on Discord. Coldshot#9461
Your discord tag does not seem to be working for me.
Sorry my has emojis you could link me yours
I programmed this for you:
local et = os.time({year = 2020, month = 9, day = 19, hour = 10, minute = 30, second = 0})
local eventTime = os.date("*t", et)
while wait(1) do
local ct = os.time()
local currentTime = os.date("*t", ct)
if currentTime.year == eventTime.year and currentTime.month == eventTime.month and currentTime.day == eventTime.day and currentTime.hour == eventTime.hour then
-- Run event
else
local hoursVal, daysVal, monthsVal, yearsVal
hoursVal = 24 - currentTime.hour
daysVal = 16 - currentTime.day
monthsVal = 9 - currentTime.month
yearsVal = 2020 - currentTime.year
print("You have " , yearsVal , " years, " , monthsVal , " months, " , daysVal , " days, and " , hoursVal , " hours left until the event.")
end
end
There are definitely improvements that could be made to it but it is a general shell of what you are looking for.