How would you align the local player's lighting to the server's on death?

I have a function with an enemy NPC that gives the player that’s attacked a sort of fog effect. This works completely fine, however when the players dies they still see the fog, which definitely isn’t the desired effect. Is there any way to reset to the server’s lighting settings without listening to the humanoid.Death event and setting it manually?

1 Like

CharacterAdded or CharacterRemoving should work fine if you’re talking about respawning

If you hope to do anything involving resetting things when the character dies, you have to listen to some kind of event and set it manually. Even the backend does this, example being cloning LayerCollectors from StarterGui to PlayerGui.

You will have to listen to the CharacterRemoving in order to figure out when to get rid of the fog effect and for best results since the reset will take place as the character is spawning back up again. Afterward, you’ll need to request what the server sees Lighting as since the client will have already changed it and have no data to go back to. Ideally do this through a RemoteFunction.