Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is a script that can weld all of a models parts?

Im trying to build a statue. which i succeeded. but i want it to be able to be draged. by that i mean the entire statue welded together into one. If i get this finished then players can drag it to there fort. and so on. got any ideas on how to do it? please. i cant weld it the old fansioned way because the parts are rotated.

1 answer

✓ Accepted answer

You can paste this into a script, which will weld everything in the model it is under:


local weldTo = --Change to part you want to weld everything to. local parts={weldTo}

function Weld(parent) for i,v in pairs(parent:GetChildren()) do if v:IsA('BasePart') and v ~= weldTo then local w = Instance.new('Weld') w.Name = 'Weld' w.Part0 = weldTo w.Part1 = v w.C0 = weldTo.CFrame:inverse() w.C1 = v.CFrame:inverse() w.Parent = weldTo table.insert(parts,v) end Weld(v) end end

Weld(script.Parent)

for i,v in pairs(parts) do v.Anchored = false end


3 comments

0

Argument on line 1 : unexpected > and < and = and near class. what am i doing wrong. and where should i put the name of the model? brush? or weldto????

0
 at the start and 	
at the end. Remove them, I have no idea why they are there, nor how to get rid of it when posting.
0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.