Basically, making a day/night cycle, and I'm trying to make fog fade out smoothly at night. That's besides the point. When I open the script, I have a red line under my else, with the error above. I can't find what I did wrong, please help.
Here is code:
local Lighting = game:GetService("Lighting")
local Interval = 0.25
local Change = 0.01
while wait(Interval) do
Lighting.ClockTime = Lighting.ClockTime + Change
end
if Lighting:GetMinutesAfterMidnight() == 18 * 60 then
while wait() do
Lighting.FogStart = Lighting.FogStart + 100
if Lighting.FogStart == 10000 then
return end
else return nil
end
elseif Lighting:GetMinutesAfterMidnight() == 6 * 60 then
Lighting.FogStart = Lighting.FogStart - 100
if Lighting.FogStart == 5000 then
return end
else return nil
end

1 comment
Put an end at line 16