I made a folder called LightingSystem,inside it a folder called Lights,inside the folder lights I added parts named Light and in them SurfaceLights. Inside the LightingSystem folder is a TouchPart and a script that makes the whole thing work. It doesn't work.
local LightingSystemFolder = script.Parent
local Lights = LightingSystemFolder:WaitForChild("lights")
local TouchPart = LightingSystemFolder:WaitForChild("TouchPart")
TouchPart.Touched:Connect(function(touch)
if not humanoid then
return
for i, Light in pairs(Lights:GetChihldren())
do
local lightBulb = Light:WaitForChild("SurfaceLight")
lightBulb.Enabled = false
print("hello light")
end
end
end)
Help please
