Good evening. I cannot figure this out. When it is past 18:15 but before 6:30, the lighting will still be turned off.
I’ve now tried it more and nothing is working.
while true do
local hourShift = -4
local timeShift = hourShift * 60 * 60
local TimeInUnix = os.time() + timeShift
local stringToFormat = "%H:%M"
local result = os.date(stringToFormat, TimeInUnix)
if result >= "18:15" then
if result <= "06:30" then
for i,v in pairs(game.Workspace.GameLighting:GetChildren()) do
v.SurfaceLight.Enabled = true
end
else
for i,v in pairs(game.Workspace.GameLighting:GetChildren()) do
v.SurfaceLight.Enabled = false
end
end
else
for i,v in pairs(game.Workspace.GameLighting:GetChildren()) do
v.SurfaceLight.Enabled = false
end
end
wait(60)
end
Any response appreciated. Thank you so much.