So I have a script that do event at specific UTC time everyday, this is the script
local events = {}
events.eventOne = {
hour = 4,--the hour in military time of when the event will happen
min = 45,--the minute of the hour
sec = 0,--the second of the minute
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event1 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
events.eventTwo = {
hour = 4,--the hour in military time of when the event will happen
min = 50,--the minute of the hour
sec = 0,
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event2 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
events.eventThree = {
hour = 4,--the hour in military time of when the event will happen
min = 55,--the minute of the hour
sec = 0,--the second of the minute
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event3 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
events.eventFour = {
hour = 5,--the hour in military time of when the event will happen
min = 0,--the minute of the hour
sec = 0,--the second of the minute
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event1 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
events.eventFive = {
hour = 5,--the hour in military time of when the event will happen
min = 5,--the minute of the hour
sec = 0,
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event2 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
events.eventSix = {
hour = 5,--the hour in military time of when the event will happen
min = 10,--the minute of the hour
sec = 0,
eventFunction = function()
--when it's time for the event, any code in here will run
local t = workspace.Timer.TimerGUI.Event3 -- replace textLable1 with wherever your 1st label is located in the explorer
local p = t.Parent
t.Parent = nil
t.Parent = p
end
}
-- any code below this line should not be changed, it works just fine on it's own.
while wait(3) do
for i,v in pairs(events) do
local t = os.date("!*t", os.time())
if v.hour == t.hour and v.min == t.min then
if t.sec < v.sec + 5 and t.sec > v.sec-5 then
v.eventFunction()
end
end
end
end
But does someone know how to make the difference (hour, minutes, seconds) between time now and time set on the event and countdown it, I mean by printing to the text label like on the script, so like the first event, it’s set for 4:45 UTC and lets say now is 6 UTC that means there are 22 hours 45 minutes again right? I want it to print to textlabel the countdown of that 22 hours 44 minutes.