The lights only turn off and change to plastic at 7AM, but when It's 6PM, the lights don't turn back on. This is what I have.
local lightPart = game.Workspace.Lights:GetChildren()
game.Lighting.LightingChanged:connect(function()
local timeAfterMidnight = game.Lighting:GetMinutesAfterMidnight()
if timeAfterMidnight >= 7 * 60 and timeAfterMidnight <= 18 * 60 then
for i,v in pairs(lightPart) do
v.Material = Enum.Material.Plastic
v.PointLight.Enabled = false
end
elseif timeAfterMidnight >= 18 * 60 and timeAfterMidnight <= 7 * 60 then
for i,v in pairs(lightPart) do
v.Material = Enum.Material.Neon
v.PointLight.Enabled = true
end
end
end)

1 comment
Oops. Thanks though!