Events in a timeframe?

I am trying to make it so that you are only able to decorate your motel room between 09:00 to 21:00 a clock IRL Time, how would one achieve that?

I check real time in my server files using os.date().
Try this;

local function toMinutes(hours, minutes)
	return hours * 60 + minutes
end

local startTime = toMinutes(9, 0) -- 09:00 UTC
local endTime = toMinutes(21, 0) -- 21:00 UTC
local currentTime = toMinutes(os.date("%H"), os.date("%M")) -- Now UTC
local inTime = false

if currentTime >= startTime and currentTime <= endTime then
	inTime = true
end

print(inTime)

This gets the start and end times in minutes since 00:00 and gets the current time in minutes, then checks if the current time is between the start and end. So this should be perfect for you. “inTime” would be something like “canDecorate”. Remember, this uses UTC so you must account for time zones. For example, I am in AEST which is UTC+10 so you should add this offset to all 3 time variables. Like this;

local function toMinutes(hours, minutes)
	return hours * 60 + minutes
end

local offset = 10
local startTime = toMinutes(9 + offset, 0) -- 09:00 AEST
local endTime = toMinutes(21 + offset, 0) -- 21:00 AEST
local currentTime = toMinutes(os.date("%H") + offset, os.date("%M"))
local inTime = false

if currentTime >= startTime and currentTime <= endTime then
	inTime = true
end

print(inTime)