It's a new piece of code I've written recently, and it will not work. Any help? I also need help with making it a gradual change without it having 10-15 lines of code.
function onTouched(part)
if game.Lighting.FogEnd = 40
then
wait(0.5)
game.Lighting.FogEnd = 0
end
script.Parent.Touched:connect(onTouched)
