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

How do you keep tools stuck together?

Asked by
Scythax 35
9 years ago

How do you use weld on a tool, to keep it together?

1 answer

Log in to vote
0
Answered by 9 years ago

You can use this script.

local weldTo = -- Set to part you want to weld everything else in the model 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

y so many weld screpts ;-;

-- Leave a +1 Rep If I helped

Ad

Answer this question