Alright, so let me explain this script first, so the script is suppose to change the two Lighting Properties after the player touches the brick and the lighting is not suppose to change after the player leaves the touched area but it's not working for some reason. Any help would be appreciated
The errors in Output:
lighting1 is not a valid member of Humanoid
lighting2 is not a valid member of Humanoid
the script:
function onTouched(part)
local h = part.Parent:FindFirstChild("Humanoid")
local lighting1 = game.Lighting.FogEnd
local lighting2 = game.Lighting.FogStart
if (h ~=nil) then
h.lighting1 = 40
h.ligthing2 = 12
end
end
script.Parent.Touched:connect(onTouched)

1 comment
I editted my post to include a working script