Code:
function WeldPart(Part0, Part1)
local Weld = Instance.new("Weld")
Weld.Part0 = Part0
Weld.Part1 = Part1
--Weld.C0 = Part0.CFrame:Inverse()
Weld.C1 = Part1.CFrame:Inverse()
Weld.Parent = Part0
return Weld
end
function WeldPartsToSelf(PartToWeld)
local Center = PartToWeld.Middle
local OriginCF : CFrame = Center.CFrame
local Z, X, Y = OriginCF:ToOrientation()
for Index, Value in PartToWeld:GetChildren() do
Value.Anchored = false
if Value.Name == "Part" then
Value:Destroy()
continue
end
--if PartToWeld.Name == "UpperTorso" or PartToWeld.Name == "RightLowerLeg" then
-- WeldPart(Center, Value)--.C0 = CFrame.Angles(X, Y, Z)
--elseif Value ~= Center then
-- WeldPart(Center, Value)
--end
WeldPart(Center, Value)
end
end