For some reason the script totally disregards the else statement as if it weren't there:
lighting = game:GetService("Lighting") clock = lighting.ClockTime bloom = Instance.new("BloomEffect") color = Instance.new("ColorCorrectionEffect") rays = Instance.new("SunRaysEffect") while true do wait(0.01) if clock >6 and clock <18 then bloom.Enabled = true bloom.Intensity = 0.1 bloom.Size = 56; bloom.Threshold = 0.6 bloom.Parent = lighting color.Enabled = true color.Brightness = 0.05 color.Contrast = 0.2 color.Saturation = 0.7 color.TintColor = Color3.fromRGB(255,255,255) color.Parent = lighting rays.Enabled = true rays.Intensity = 0.3 rays.Spread = 1 rays.Parent = lighting lighting.Ambient = Color3.new(0,0,0) lighting.Brightness = 1; lighting.ColorShift_Bottom = Color3.new(0,0,0) lighting.ColorShift_Top = Color3.new(0,0,0) lighting.OutdoorAmbient = Color3.new(127/255,127/255,127/255) else color.TintColor = Color3.fromRGB(54,54,54) end end
And please, before you say something like, "line 2 clocktime won't change" just know that I created a while true do loop with :SetMinutesAfterMidnight() that loops it from 12 and back with an interval of 1 minute/second.
Things I've tried: Since else seemed to not work, I tried elseif which would seem redundant, but what else am I supposed to do? I've also tried using spawn(f) to just get rid of the else altogether, but that still doesn't work.
You should probably try use
if lighting.ClockTime >6 and lighting.ClockTime < 18 then