This was working earlier, but suddenly stopped. Any help? I also get this error: 15:06:06.860 - SpotLight is not a valid member of SurfaceGui 15:06:06.861 - Script 'Workspace.MainLights.Script', Line 15 15:06:06.861 - Stack End 15:06:06.861 - Disconnected event because of exception
open = script.Parent.Open.Value
local lights = {}
lights = game.Workspace.MainLights:GetChildren()
function operate()
if open == false then
for _,v in pairs(lights) do
v.SpotLight.Enabled = true
script.Parent.BrickColor = BrickColor.new(37)
open = true
wait()
end
else
for _,v in ipairs(lights) do
v.SpotLight.Enabled = false
script.Parent.BrickColor = BrickColor.new(21)
open = false
wait()
end
end
end
script.Parent.ClickDetector.MouseClick:connect(operate)

1 comment
No, still not working. If this helps, I get this error: 15:06:06.860 - SpotLight is not a valid member of SurfaceGui 15:06:06.861 - Script 'Workspace.MainLights.Script', Line 15 15:06:06.861 - Stack End 15:06:06.861 - Disconnected event because of exception