I'm trying to "turn off" all my lights at the press of a TextButton I used FindFirstChild() and I set the recursive step to true but my lights Enabled property is still true and its material does not change. Thought strangely is runs without errors and runs fully until the printing. Any and all help is appreciated.
script.Parent.PowerOff.MouseButton1Click:connect(function()
local Lights = workspace.AllLights:FindFirstChild("SpotLight", true)
Lights.Enabled = false
Lights.Parent.Material = Enum.Material.SmoothPlastic
print("Power is off")
end)

1 comment
Thank you so much!