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

Setting the lighting color correction brightness globally and adjusting it locally?

Asked by 5 years ago

I scripted a system in which the time of day determines the lighting colorcorrection brightness (to make darker nights). The problem is, I want to use the brightness adjustment to make dark tunnels, but I would set it locally... Would a change in the value for server side result in a reset of the clients ode brightness? For example: It is noon, no 0 brightness serverside. Player enters tunnel: local brightness =-0.2 It turns night outside, serverside brightness =-0.2 It turns day outside, serverside brightness = 0, player brightness =?

0
first of all, please but your code in a code block , it makes it easier to understand theking48989987 2147 — 5y

1 answer

Log in to vote
0
Answered by
green271 635 Moderation Voter
5 years ago

FilteringEnabled

The purpose of FilteringEnabled is to stop changes to the client from replicating to the server. This means that any change with a LocalScript with only show up for the invidiual player. A change made with a Server Script will show for everyone.

You can use a LocalScript with a Touched event to make the player's brightness darker.

Here is an example

game.Workspace.TouchPart.Touched:Connect(function()
    local brightness = -0.2
    -- make lighting dark
end)

This will only make the brightness for the Player who touched TouchPart dark.

0
I know this, but the question is if the server side value has changed, if that value will be replicated to the client if the client has set its brightness to something different? Rubenske1 89 — 5y
0
Yes. It will override it. green271 635 — 5y
0
I suggest you handle all the value editing locally, if you want the server to keep track of when to switch server-wide values just send it in a remote event, the player can then store that value and go back to that whenever it is not in a tunnel anymore. gullet 471 — 5y
Ad

Answer this question