I'm trying to make a script that changes the FogColor of Lighting when the ClockTime changes, however it produces no errors in the output.
local lighting = game:GetService("Lighting")
lighting.Changed:Connect(function()
if lighting.ClockTime == 6.4 then
for i = 1, lighting.FogColor.R do
lighting.FogColor = lighting.FogColor + Color3.fromRGB(1, 1, 1)
end
elseif lighting.ClockTime == 18 then
for i = 1, lighting.FogColor.R, -1 do
lighting.FogColor = lighting.FogColor - Color3.fromRGB(1, 1, 1)
end
end
end)
Why isn't this working and how can I fix it? Please help!
