I am trying to get all the PointLights in a model. They are embedded in model in a model in a model, etc.
Here is my current code. I want lights array to be all the PointLights. named PointLight.
local lights = {}
local children = house:GetChildren()
for i = 1, #children do
if children[i].Name == "PointLight" then
lights.append(children[i])
end
end
On a side note is .append() a real thing in LUA? (I have not tested it because I cannot get there)
children is contains just the direct descendants of house

2 comments
-1 for ineffiency
@cabbler do you have a more efficient solution?