So I'm trying to make a system where if the game's time is before 6:00 am or after 9:00 pm, the game would have fog appear. I run a loop to check if the game's time is 6:00 am or 9:00 pm, but the fog wouldn't appear. Here's my code:
local ct = game.Lighting.ClockTime
while true do
wait(0.05)
if ct <= 6 or ct >= 20 then
game.Lighting.FogEnd = 150
else
game.Lighting.FogEnd = 100000
end
end
The fog never appears at all once it hits any of those times. I am also running a Day and Night cycle script, but it doesn't do anything with fog, just the time.

3 comments
Try using "and" instead of "or".
it still doesnt work
Would I use GetPropertyChanged("ClockTime") instead of a loop?