Script not working

D = game.Lighting.Atmosphere.Density
game.ReplicatedStorage.FogChange.OnClientEvent:Connect(function()
	print("Event detected for fog")
	D = 0
end)

made a post earlier and got an awnser from it, but this code isn’t working? the density is not being changed to 0. the event is being fired because it prints “event detected for fog” but the fog never actually changes. why?

Resolved it myself, the issue was that ‘D’ was being defined instead of “Density”, i am curious as to how this doesn’t work in this instance and how it does on other instances since i already defined “D”.