Using TweenService to change Lighting properties

I’ve been trying to make a UI button change lighting stuff, is it something with the event or just change it with lua button.MouseButton1Click ?

script:

events.mapdark.OnServerEvent:Connect(function()
	if lighting.atmos.Density == 0.35 then
		tween:Create(lighting.atmos, TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0.5), {Density = 0.65}):Play()
		tween:Create(lighting, TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0.5), {ExposureCompensation = -1.5}):Play()
	else
		tween:Create(lighting.atmos, TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0.5), {Density = 0.35}):Play()
		tween:Create(lighting, TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0.5), {ExposureCompensation = 0}):Play()
	end
end)

I’m confused regarding your question, however if you want it to show for all players, handle it in a ServerScript with a OnServerEvent event. If you want it to show for each player that clicks a button on the UI, then you’ll have the code in a LocalScript and MouseButton1Click.

Reading your code, it seems like you want to change the lighting settings whenever a remote is fired, and a check if the Density is set to .35. You can fire a RemoteEvent from a TextButton in a LocalScript using MouseButton1Click and have it fade, correct.

Why not change it on the client?

Also, you don’t need a remote event if it’s a button. Just connect an event on the server for GuiObject.MouseButton1Click.