I’m having a Halloween event for my game and I want to script it where it ends on the exact time the event ends View the event here
You will need to setup a time-based script so that requires real world time.
Script Example
local eventEndTime = 1730516400 -- Example end time (UNIX timestamp format)
local currentTime = os.time()
-- Function to check if the event has ended
local function checkEventEnd()
if currentTime >= eventEndTime then
print("Event has ended!")
-- Trigger update, change game state, etc.
publishEventUpdate()
else
print("Event is still ongoing.")
end
end
-- Function to publish event update
function publishEventUpdate()
-- Insert your update logic here (e.g., show UI changes, update game features)
print("Publishing update: Event has concluded.")
end
-- Schedule to check the event status every minute
while true do
currentTime = os.time()
checkEventEnd()
wait(60) -- Wait 60 seconds before checking again
end