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

Help with this script?

I am making a script so when you walk inside a building it removes the fog (which I have completed) but the only issue is that it turn the fog off for everyone on the server. So I tried making it with LocalScript's and they did not work. Is there any other way to make this work. Also here are the scripts and everthing is placed in the workspace and the scripts are insde a part.

The off script:

function off()
game.Lighting.FogEnd = 100000
end
script.Parent.Touched:connect(off)

The on script:

function on()
game.Lighting.FogEnd = 200
end
script.Parent.TouchEnded:connect(on)

3 answers

Unless you're using FilteringEnabled, I don't think there's a way to make this only work for one player.

1 comment

0

To do it without filtering would require each client to repeatedly set the properties of lighting in a RenderStepped loop, like BlueTaslem (i think?) demonstrated in his local lighting hack some years ago.

you should make it so it triggers your player try this

player=game.Players.LocalPlayer

2 comments

0

ceep it on localscript

0

This will not affect the outcome of the script in any way.

function off()
game.Lighting.FogEnd = 100000-- Fog End makes it to a point where you cannot see your screen
-- The best way  to handle what you want is to make a GUI and cover your whole screen and the gui could be destroyed or remain
end
script.Parent.Touched:connect(off) --


function on()
game.Lighting.FogEnd = 200--  right here could be your starting
end
script.Parent.TouchEnded:connect(on)


10 comments

0

This isn't a valid answer.

0

what is defined as a valid answer? That's opinionated..

0

Also https://scriptinghelpers.org/help/how-post-good-questions-answers -- my answer is the exact definition under the further explanation of rules, you simply like downvoting me dont you..

0

A valid answer for me atleast is another way to make it so when going into a house the fog turns off. Is there any other way I could do this with out making it so I have to walk on a brick?

0

Also so it does not effect every client.

0

that is difficult to say, because the only thing that can affect if 1 user can see something is through local parts http://wiki.roblox.com/index.php/Local_parts which is told on this site. Soo, you can always create your own fog and not rely on the lightning to do it for you

0

It just looks soo bad with the GUI

0

well, because you cannot force lightning to be a local part, and you refuse to use local part then it is not possible at this time in roblox

0

@scottmike0 What I mean by "That isn't a valid answer." is "it doesn't answer the question at all"

0

It does, I clearly stated it in green, sorry if you are color blind, I am unable to fix that.

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