How do I make a script where it welds everything in a tool? (Handle)

for i = 1, #model:GetChildren() do
	local weld = Instance.new("Weld")
	weld.Part0 = model[i]
	weld.Part1 = model[i+1] 
	weld.Parent = model[i]
end

– Current code

Doesn’t weld at all

You could do it like this:

for i = 1, #model:GetChildren() do
	local weld = Instance.new("Weld")
	weld.Part0 = model:GetChildren()[i]
	weld.Part1 = model:GetChildren()[i+1] or model:GetChildren()[1]
	weld.Parent = model:GetChildren()[i]
end

or you could weld it all to a main part.

local mainpart = model.Handle

for i,v in pairs(model:GetChildren()) do
	local weld = Instance.new("Weld")
	weld.Part0 = v
	weld.Part1 = mainpart
	weld.Parent = mainpart
end
2 Likes

Thanks very much, I’ve been struggling with the script lol
:sweat:

We have all been there before :sweat_smile: