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 =?
Setting the lighting color correction brightness globally and adjusting it locally?
1 answer
###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.
3 comments
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?
Yes. It will override it.
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
first of all, please but your code in a code block , it makes it easier to understand