So I copied some code from the api reference here, but the code I have just isn’t doing anything.
Here’s my code:
local descendants = game.Workspace:GetDescendants()
for index, descendant in pairs(descendants) do
if descendant:IsA("SurfaceLight") then
descendant.Enabled = false
end
end
put a print before your forloop to see if it even runs in the first place. then put a print on the first line of the for loop to see which objects are being read as a descendant