Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago

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
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???? legoson7 70 — 9y
0
<pre class="brush: lua"> at the start and </pre> at the end. Remove them, I have no idea why they are there, nor how to get rid of it when posting. LunaScripter 80 — 9y
0
thanks legoson7 70 — 9y
Ad

Answer this question