The way I do hostler is take a fake torso identical to a character torso, put a model where it should welded, once the player has acquired an appropriate tool with a hoslter it takes the model parts and welds them to the fake torso whereas the rest of the model parts are welded to the origin part, causing the cframes to be the same when placed on origin part (fake torso).
But this has caused an issue where attempting to weld a model with multiple parts/humanoids, it causes the character to lean.
local function _findFolder(_part)
for _,v in _itemHolster._Parts:GetChildren() do
return v.Name == _part.Name and v or nil
end
end
local function _RigParts(Part)
local _rigFolder = _findFolder(Part)
if _rigFolder then
for _,v in _rigFolder:GetDescendants() do
if v:IsA("BasePart") then
--v:SetAttribute("OriginalTransparency", v.Transparency)
if v.Name == "FakeTorso" then
v:Destroy()
continue
end
local Weld = Instance.new("Weld")
Weld.Name = v.Name.."W"..math.random()
Weld.Part0 = Part
Weld.Part1 = v
Weld.C0 = _rigFolder.FakeTorso.CFrame:Inverse()
Weld.C1 = v.CFrame:Inverse()
Weld.Parent = v
v.Anchored = false
v.Massless = true
v.CanCollide = false
v.CanTouch = false
end
end
end
end
for _,characterPart in Character:GetChildren() do
if characterPart:IsA("BasePart") and characterPart.Name ~= "HumanoidRootPart" then
_RigParts(characterPart)
end
end