My atmosphere change code not working

Hello, i tried to make a atmosphere change script that works on client-side (has remote event) but its not working, there isnt any error at output

local script

local RemoteEvent = game.ReplicatedStorage.Atmosphere.SoulAtmosphere

RemoteEvent.OnClientEvent:Connect(function()
	local Lighting = game.Lighting
	local Atmosphere = Lighting.Atmosphere
	Atmosphere.Density = 0.6
	Atmosphere.Offset = 0
	Atmosphere.Color = Color3.new(8, 144, 207)
	Atmosphere.Decay = Color3.new(0, 143, 138)
	Atmosphere.Glare = 0.3
	Atmosphere.Haze = 3
end)

legacy script

local RemoteEvent = game.ReplicatedStorage.Atmosphere.SoulAtmosphere
local debounce = false

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and debounce == false then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)	
		RemoteEvent:FireClient(plr)
		debounce = true
	end
end)

Can you help me

1 Like

Where is the client script at?

1 Like

Its at replicated storage in the remote event

1 Like

Client scripts dont work there

1 Like

oh then thats why its not working i will change it’s position and try again thank u

I changed it’s position to workspace but still its not working

Where did u put the local script?

2 Likes

i put it to the workspace directly

Local scripts only work in starter so put it in starterplayerscripts or startercharacterscripts or startergui

2 Likes

O yeah youre right, thank you for the help. its now working

1 Like

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