Title says everything
Here’s what I’ve currently got
-- Module script in ReplicatedStorage (not the entire thing)
function Utility:GetDescendantsOfClass(Parent, Type)
local Table = {}
for _, Object in ipairs(Parent:GetDescendants()) do
if Object:IsA(Type) then
table.insert(Table, Object)
end
end
return Table
end
-- Call from localscript
print(Utility:GetDescendantsOfClass(parent, "Part"))
For some reason when I call the function, it returns all descendants and not just parts
Did I mess something up? Should I not have it in a module script?