Put Weld Constraint in a model by running a command

Hi, I need to put Weld Constraints on my model that contains about 1000 parts; some are unions and others are normal parts. The point is, it would take a long time to give each part a WeldConstraint. Part1 is the PrimaryPart.
I tried to use this command

local Ship = workspace.CargoShip
local Part1 = Ship.PrimaryPart

for i, Part0 in pairs(Ship:GetChildren()) do
if Part0:IsA(“BasePart”) and not (Part0 == Part1) then
local WeldConstrint = Instance.new(“WeldConstraint”)
WeldConstrint.Part0 = Part0
WeldConstrint.Part1 = Part1
WeldConstrint.Parent = WeldConstrint.Part0

	Part0.Anchored = false
end

end

Part1.Anchored = true
Part1.CanCollide = false

But only some WeldConstraint is active and others are inactive