I tried to combine 2 different scripts so that I could make a zone where when you touch it or go inside of it the sky texture changes. For example, once you go into the part the script accesses the sky and changes each texture to a green one. The problem I'm having is that when I use a local script this doesn't work. The sky is in lighting and the local script is inside of a part and when I use a normal script it works fine, but when I use a local script the script doesn't work.

Sky = game.Lighting.Sky
Button = game.Workspace.SkyButton

local back = Sky.SkyboxBk
local down = Sky.SkyboxDn
local front = Sky.SkyboxFt
local left = Sky.SkyboxLf
local right = Sky.SkyboxRt
local up = Sky.SkyboxUp

function onTouchEnded(hit)
    back = ("http://www.roblox.com/asset/?id=591058823")
	down = ("http://www.roblox.com/asset/?id=591059876")
	front = ("http://www.roblox.com/asset/?id=591058104")
	left = ("http://www.roblox.com/asset/?id=591057861")
	right = ("http://www.roblox.com/asset/?id=591057625")
	up = ("http://www.roblox.com/asset/?id=591059642")
	Sky.SkyboxBk = back
	Sky.SkyboxDn = down
	Sky.SkyboxFt = front
	Sky.SkyboxLf = left
	Sky.SkyboxRt = right
	Sky.SkyboxUp = up
end

function onTouch(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    back = ("http://www.roblox.com/asset/?id=2977744631")
	down = ("http://www.roblox.com/asset/?id=2977748981")
	front = ("http://www.roblox.com/asset/?id=2977749183")
	left = ("http://www.roblox.com/asset/?id=2977750448")
	right = ("http://www.roblox.com/asset/?id=2977750746")
	up = ("http://www.roblox.com/asset/?id=2977750901")
	Sky.SkyboxBk = back
	Sky.SkyboxDn = down
	Sky.SkyboxFt = front
	Sky.SkyboxLf = left
	Sky.SkyboxRt = right
	Sky.SkyboxUp = up
    script.Parent.TouchEnded:connect(onTouchEnded)
end
script.Parent.Touched:connect(onTouch)

I'm not sure if this is because certain things don't work with local scripts or if local scripts can access lighting, and if they cant I need to figure out how.