im tryna make a non player humanoid model through a local script with the Players:CreateHumanoidModelFromUserId(Player.UserId) function and for the most part its working but when i’m trying to make the model to hold a sword with Humanoid:EquipTool() it adds the sword to the model but its not attached to the hand
bump bump bump bump bump bump bump
Where is the tool located before equipping?
Inside the local script (the localscript is inside starterplayerscript)
Try parenting the tool to the character first and then use :EquipTool.
Same result, the sword is is inside the character but the sword isnt attached to the hand.
This is a known bug. You can get around it by using the ‘HumanoidRootPart’ to get the left and right hand:
local player = game.Players.LocalPlayer
local model = player.Character
local humanoid = model.Humanoid
local handRight = humanoid.HumanoidRootPart[“Right Hand”]
local handLeft = humanoid.HumanoidRootPart[“Left Hand”]
local tool = Instance.new(“HopperBin”, player.Backpack)
tool.Name = “Sword”
local handle = Instance.new(“Part”)
handle.Name = “Handle”
handle.Size = Vector3.new(0.4, 0.4, 0.4)
handle.CFrame = CFrame.new(0, 1, 0)
handle.BottomSurface = “Smooth”
handle.TopSurface = “Smooth”
handle.Material = “Plastic”
handle.Anchored = true
handle.CanCollide = false
handle.Parent = tool
local handleWeld = Instance.new(“Weld”)
handleWeld.Part0 = handle
handleWeld.Part1 = tool
handleWeld.C0 = CFrame.new(0, 0, 0)
handleWeld.C1 = CFrame.new(0, 0, 0)
handleWeld.Parent = handle
local blade = Instance.new(“Part”)
blade.Name = “Blade”
blade.Size = Vector3.new(0.4, 0.4, 0.4)
blade.BottomSurface = “Smooth”
blade.TopSurface = “Smooth”
blade.Material = “Metal”
blade.Anchored = true
blade.CanCollide = false
blade.Parent = tool
local bladeWeld = Instance.new(“Weld”)
bladeWeld.Part0 = blade
bladeWeld.Part1 = tool
bladeWeld.C0 = CFrame.new(0, 0, 0)
bladeWeld.C1 = CFrame.new(0, 0, 0)
bladeWeld.Parent = blade
tool.Parent = player.Backpack
humanoid:EquipTool(tool)
– Right hand
local rightHandWeld = Instance.new(“Weld”)
rightHandWeld.Part0 = tool
rightHandWeld.Part1 = handRight
rightHandWeld.C0 = CFrame.new(0, 0, 0)
rightHandWeld.C1 = CFrame.new(0, 0, 0)
rightHandWeld.Parent = tool
– Left hand
local leftHandWeld = Instance.new(“Weld”)
leftHandWeld.Part0 = tool
leftHandWeld.Part1 = handLeft
leftHandWeld.C0 = CFrame.new(0, 0, 0)
leftHandWeld.C1 = CFrame.new(0, 0, 0)
leftHandWeld.Parent = tool