How do I change only one persons Lighting state?

I’m making a map where if the player steps into a different area the lighting changes, I’m using a local script for this but it doesn’t seem to work!

local Lighting = game:GetService'Lighting'
local Players = game:GetService'Players'
local LocalPlayer = Players.LocalPlayer
local LightingPart = script.Parent

local function OnTouched(Touched)
	local Player = Players:GetPlayerFromCharacter(Touched.Parent)
	if Player and Player == LocalPlayer then
		Lighting:GetChildren():Destroy()
		local a = Instance.new("Atmosphere")
		a.Color = Color3.new(0.478431, 0.521569, 1)
		a.Decay = Color3.new(0.831373, 0.392157, 0.0352941)
		a.Glare = 0.67
		a.Haze = 1.2
		local s = Instance.new("Sky")
		s.CelestialBodiesShown = true
		s.MoonAngularSize = 11
		s.MoonTextureId = "rbxasset://sky/moon.jpg"
		s.SkyboxBk = "http://www.roblox.com/asset/?id=4934310"
		s.SkyboxDn = "http://www.roblox.com/asset/?id=4692880"
		s.SkyboxFt = "http://www.roblox.com/asset/?id=4692880"
		s.SkyboxLf = "http://www.roblox.com/asset/?id=4692880"
		s.SkyboxRt = "http://www.roblox.com/asset/?id=4692880"
		s.SkyboxUp = "http://www.roblox.com/asset/?id=5858354"
		s.StarCount = 3000
		s.SunAngularSize = 21
		s.SunTextureId = "rbxasset://sky/sun.jpg"
		local b = Instance.new("BloomEffect")
		b.Enabled = true
		b.Intensity = 1
		b.Size = 24
		b.Threshold = 2
		local su = Instance.new("SunRaysEffect")
		su.Enabled = true
		su.Intensity = 0.01
		su.Spread = 0.1
	end
end

LightingPart.Touched:Connect(OnTouched) 

This is the local script which is in a part at the start of the area and when the player touches it that’s supposed to happen but it doesn’t? Help would be appreciated thank you!

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

  • A Player’s Backpack , such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts .
  • The ReplicatedFirst service

LocalScript

In other words, put it in StarterCharacterScripts or StarterPlayerScripts


? It cant get lighting from a localscript?