I have this : function onTouched(hit) game.Lighting.FogColor = "Bright red" game.Lighting.FogEnd = 100 end script.Parent.Touched:connect(onTouched)
COMMUNITY QUESTION
How do I change the fog color from a script?
2 answers
local CustomColor = -- put the color here, RGB or the name
local fog = game.Lighting.Fog -- the fog
local part = script.Parent -- the part getting touched
part.Touched:connect(function() -- when part touched..
fog.Color = CustomColor -- change to fog color
end -- change this to end) if it won't work :P
Try this, It may not work but that's the best i can do, feel free to accept answer if it works, thanks, by greatneil80 :)
The fog color is a Color3 value, not a BrickColor. Adding this to your script, we get:
function onTouched(hit)
game.Lighting.FogColor = Color3.new(1, 0, 0) --This will set the fog to red.
game.Lighting.FogEnd = 100
end
script.Parent.Touched:connect(onTouched)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
it needs to be end)