Lighting doesn't change when I run the code

Hello, I’m trying to change the brightness using a proximity prompt. First I run this code from a tool using a localscript. (I’ve tried using a normal script instead, but I got the same error)

script.Parent.Activated:Connect(function()
	game.Lighting.Brightness = 1
end)

After that I run this code from a normal script attached to a proximityprompt.

script.Parent.V.Triggered:Connect(function()
	game.Lighting.Brightness = 3 --The default is 3
end)

After repeating this, the brightness won’t change back to 3. I don’t understand why it works the first time, but then it no longer works.

LocalScripts runs on the client, so the lighting changes only for that player only.
A Server Script (Normal scripts) runs on the server.

So the lightning did change, but not for the local player.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.