Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Fog script isn't working. Help?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago
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.

Ad

Answer this question