Hi, I know the answer to what I want to achieve but I was wondering if there's a shorter way of doing this (I'm trying to use as few characters as possible):
k=workspace.M:GetDescendants()
for i=1,#k do
if k[i]:IsA("Part")then print("y")end end
A faster way would be to do something like this:
k=workspace.M:GetDescendants():IsA("Part")
But the example above does not work. How would I do that?
If this worked, the table k would contain all part descendants without me having to write a for loop.
EDIT: I'm trying to achieve the alternative shortest possible method of doing this, but my question is if it is even possible to do two methods in one go like my example?

8 comments
Are you trying to find a specific part?
of a specific class?
What are you trying to achieve here, just to make code shorter? and if so then the top method is probably the fastest if you want to get all parts in workspace.M
Sorry, I meant shortest not fastest.
I want insert all "Part" class types from a Model with multiple descendant objects without having to iterate through the model. I want to use Roblox's methods to achieve this. A method I wish Roblox had was :GetDescendantsThatAreParts <--.
@poke7667 Yes, I'm trying to achieve the alternative shortest possible method of doing this, but my question technically is if it is even possible to do two methods in one go?
There is no way faster
Also no, it isn't