IsA Script attempting nil value

Im trying to get all the lights in my game but I get nil. How can I fix it?

You have to iterate through all the children of workspace using a for loop or some like method,

for i,child in ipairs(workspace:GetChildren()) do
    if child:IsA('PointLight') then
        ...
    end
end
1 Like