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

Changing FogDistance and Ambient for one player?

Okay, so I've seen this effect used in a lot of games where you can toggle between fog on and fog off but it only effects your player. Or when you wear "night vision goggles" and it only changes your ambient. I would like to know how this works if anyone knows.(Maybe it has something to do with current camera but I can't find anything on the wiki...)

Thanks, ~Sweetpea11fir

3 answers

✓ Accepted answer

Method 1

I had an epiphany one night about how to cause local lighting and implemented it the next morning.

If you use the Changed event on the Lighting service, a LocalScript can turn back the change caused by someone else, and so the LocalScript governs what the lighting looks like. (The effect of this is a psychedelic strobe on the Server side -- but none of the clients see this)

That led to the various local-lighting APIs that are floating around; it's pretty easy to implement yourself.

(This method is not a good one, but it means you don't have to do anything to your place to make it work)


Method 2

Use workspace's FilteringEnabled. This property, when enabled, makes any change caused by a LocalScript to be ignored by the server -- so just modify the lighting with LocalScripts, and those modifications are local to that one client.

However, this can also mess-up scripts that weren't designed with FilteringEnabled intended (since the server then ignores everything a LocalScript does). Currently ROBLOX recommends all places use FilteringEnabled, though, so that should just be some necessary work.

More detail remember this is a helping centre not a give away a random script centre.

2 comments

0

Wow. Okay. I wasn't asking for the script, idiot, I was asking how one would do it.

0

It's the same thing. I'm not kidding...

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