Hey I am creating a live event for my game.
I am using os.time() to determine what the current time is, and I am using a table in the params to specify when the live event will start.
The error is: 14:46:18.710 Workspace.LiveEvent.TimeDisplay.LiveEventHandler:1: field 'day' missing in date table
Server script:
local TimeOfEvent = os.time({Year = 2021, Month = 5, Day = 8, Hour = 14, Minute = 50, Second = 10}) -- Here
local TimeLabel = script.Parent.TimeGui.TimeText
while wait(1) do
local TimeDifference = TimeOfEvent - os.time()
if TimeDifference >= 0 then
local Hour = math.floor(TimeDifference / 60 / 60)
local Minute = math.floor(TimeDifference / 60 - (Hour * 60))
local Second = TimeDifference - (Minute * 60) - (Hour * 60 * 60)
local HMS = string.format("02i", Hour) .. ":" .. string.format("02i", Minute) .. ":" .. string.format("02i", Second)
TimeLabel.Text = HMS
if TimeDifference == 0 then
print("Live event has started!")
break
end
end
end