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)
function onTouched(part) if game.Lighting.FogEnd == 40 --Don't forget to put two equal signs when comparing. then wait(0.5) game.Lighting.FogEnd = 0 end end --Always add an 'end' for an 'if' statement. script.Parent.Touched:connect(onTouched)
If you have any other questions, feel free to send me a message through my ROBLOX inbox.