I am confused on how to weld characters Lets say I have a torso and Head I want to wield both parts local parent = script.parent local torso = torso local head = head function weld() torso.Part0 head.Part1
?? I am very confused.
For further posts, you should put code in a code block.
Here's the solution to your problem, assuming the script is in a character:
local parent = script.Parent local torso = parent.Torso local head = parent.Head local function weld(part0, part1) local weld = Instance.new("Weld", part0) weld.Part0 = part0 weld.Part1 = part1 weld.C0 = part0.CFrame:inverse() * part1.CFrame return weld end weld(torso, head)
What this bit here...
part0.CFrame:inverse() * part1.CFrame
... does is get part1's positional and rotational properties in relation to part0.
I hope this helps. Good luck!
local prev = script.Parent local parts = script.Parent:GetChildren() for i = 1,#parts do if (parts[i].className == "Part") then if (prev ~= nil)then local weld = Instance.new("Weld") weld.Part0 = prev weld.Part1 = parts[i] weld.C0 = prev.CFrame:inverse() weld.C1 = parts[i].CFrame:inverse() weld.Parent = prev end prev = parts[i] end end ---this script works for welding ---not quite sure how it works