Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Fog script isn't working. Help?

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)

1 answer

✓ Accepted answer
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.

This discussion is preserved as it was. New answers, comments, and votes are closed.