Script works but is not local

So I made this script in my text button which fires the RemoteEvent to make the game brighter,

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.FireBritghtLow:FireServer()
end)

I made a ColorCorrection and turned it to disabled, this is the script I put in ServerScriptService:

game.ReplicatedStorage.FireBritghtLow.OnServerEvent:Connect(function()
    game.Lighting.ColorCorrection.Enabled = true
    end)

The script works like I wanted, but whenever a player pressed the button, the ColorCorrection get enabled for all players in the game, how can I fix that this does not happen for all players but only for the person who pressed the button.

1 Like

You need to get rid of the whole server bit. Anything you want done locally shouldn’t involve the server. Here is how your LocalScript should read:

script.Parent.MouseButton1Click:Connect(function()
    game.Lighting.ColorCorrection.Enabled = true
end)

You need to do it on the client.

Ok so as @JarodOfOrbiter said get rid of the server script but if you still want a Remote event you have to use something else called Bindable Events it follows the same things as Remote events just for local scripts.

I tried to do that already, when I did this didn’t work. Now it worked, thank you for the help!

1 Like

Anything that should only reflect locally (to a single client) should be handled by local scripts only.

script.Parent.MouseButton1Click:Connect(function()
	game.Lighting.ColorCorrection.Enabled = true
end)