I'm trying to make a welding script for a Model. There are Models inside the Models and even further, and I need to not use methodception (or at least try to avoid it) and get a table of all the children in all the models that aren't models. This is my code so far:
--what am i in?
v = script.Parent
--what to weld to
d = v.VehicleSeat
--weld script
local function weld(b)
local weld = Instance.new("ManualWeld")
weld.Part0 = d
weld.Part1 = b
weld.C0 = CFrame.new()
weld.C1 = b.CFrame:inverse() * d.CFrame
weld.Parent = d
return weld;
end
--welding time
for k,o in pairs(v:GetChildren()) do
if o:IsA("Model") then
--this is where I want to do the code, but don't want repetion
elseif o:IsA("BasePart") then
weld(o)
end
end
I've commented the code where I need to do the stuff.

1 comment
Don't you mean to table the items that are models? Also, you want to put their names in a table, correct?