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

Is it possible to make the local player experience different ambient lighting?

Asked by 9 years ago

IE, if I wanted the world to be dark for some players, but a script make the world brighter to a specific player, like nightvision, is this possible?

0
Do not rework all your local script stuff, just look at my answer. Cause that would be pretty annoying. EzraNehemiah_TF2 3552 — 9y

2 answers

Log in to vote
4
Answered by
magnalite 198
9 years ago

Yes you can use FilteringEnabled and change the lighting on a local script. You can also connect a function to the .Changed event in lighting on both client and server side and change the settings in that (however this is EXTREMELY bad code practice, please use FilteringEnabled instead).

0
Oh so is that what FilteringEnabled does? Looking at the wiki, it seems that'd likely break alot of my things. I have a few tools that create parts and use localscripts, as well as some scripts in starterGUI to control certain values. I don't think that'd work for me at all. Not sure about your other option either Maxwell_Edison 105 — 9y
0
FilteringEnabled stops localscripts changing things on the server, so if you are making parts with a localscript then yes it will break that. magnalite 198 — 9y
0
Well darn. Either I re-work all of my tools and things, or I look for another way to make nightvision. Shame ROBLOX doesn't have FilteringEnabled as say, a script property for local scripts, so you can make specific things replicate or not. Maxwell_Edison 105 — 9y
0
Well I guess that's the only answer I'm getting, so thanks anyways I guess Maxwell_Edison 105 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

I think that it's hard to understand magnalite's answer. This is would I would of done. There is this thing called a LocalPart which uses a local script(obviously...). I would use local parts even though it shouldn't be used, but's it's like: remove:destroy::LocalPart:Non-hackish-way-of-making-a-part-visible-to-other-players.



Making Local Parts

There are 2 ways of making local parts. The first is using a local script and a message.

local msg = Instance.new("Message", game:GetService("Players").LocalPlayer.Character)
local part = Instance.new("Part", msg)

2nd way, using the camera.

local part = Instance.new("Part", workspace.Camera) --LocalScript


All you need is to edit the position, size, and everything you would do to a normal part made by a normal script. Remember to add the light into it, like a point light.


Read all the warnings under the "Caveats" section: Here


Hope this helps!

0
Making local parts has nothing to do with local lighting. Redbullusa 1580 — 9y
0
It does if you put a pointlight in the local part. That aside, ROBLOX'S half-competent lighting system only supports a very small radius, making for an extremely small area of night vision. Maxwell_Edison 105 — 9y

Answer this question