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

Welding help, How to weld more then 2 parts and how to weld models?

Asked by 5 years ago

Hey so I'm relatively new to scripting and I'm jumping into welding right now. I don't want to use someone else's script because that wont help me understand welding or CFrame. My question is: How would I go about welding more then 2 parts in a Tool, and how would I weld a part in my tool to a model in my tool. I know how to weld 2 parts together but I have no clue how I would go about welding 5 or 7 parts, and how I would weld a part to a model in my tool, or a model to another model in my tool.

0
script please User#23365 30 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
--Defining some variables
local tool = script.Parent
local handle = tool.Handle
local spoon = tool.Spoon

local function WeldAtoB(p1,p2)
    local weld = Instance.new("ManualWeld",p1)
    weld.C0 = p1.CFrame:inverse() * p2.CFrame
    weld.Part0 = p1
    weld.Part1 = p2
    return(weld)
end

WeldAtoB(handle,spoon)

Heres the script i have currently, straight from the roblox dev wiki, how would i go about welding multiple parts? the tool is a spoon. Inside the spoon there is also a liquid, and some parts which are grouped. How would i go about welding multiple parts? Can you have multiple welds in a part?, how would I go about doing this while minimizing all potential lag?

Ad

Answer this question