Tool not attaching to the hand

Hello! I am confused on why my tool is not attaching…
There is only one part named “Handle” so welding is not the issue here.

I am trying to make it so that when you press a key you equip it, i’ve disabled the backpack so im using a script to equip the tool.

Here is the script:

		 if weapon.Value == "Dagger" then
			weapon.Equipped.Value = true
			local daggerClone = game.ReplicatedStorage.Weapons:WaitForChild("Dagger"):Clone()
			human:EquipTool(daggerClone)

			sound.SoundId = "rbxassetid://5917819099"
			sound2.SoundId = "rbxassetid://2706199011"
			sound:Play()
		end

Everything works and the tool is in the character but it doesnt attach to the hand and instead falls on the ground in the spot where it was placed in the workspace.

Thank you!

1 Like

Try put the tool in your backpack and then use :EquipTool()

Are you using a server Script? Try firing a remote from a LocalScript to humanoid:EquipTool() on the server server script.

Otherwise, like @CharranCZ said, if you are using a LocalScript, then the tool would need to be in the backpack before humanoid:EquipTool().

3 Likes

The tool needs to be in the backpack, but since you don’t want to use the backpack, convert it to an accessory and use:

humanoid:AddAccessory()

on the server. You can then script the accessory to play a slash type animation.

1 Like

This will work. :slight_smile:

Just make sure you’ve checked after character and humanoid beforehand.

local CloneTool = TestTool:Clone()
CloneTool.Parent = player.Backpack
player.Character.Humanoid:EquipTool(CloneTool)

I’m using a local script, i’ve also put the weapons in the backpack and used humanoid:EquipTool() from there but it still doesnt work

It still doesn’t work unfortunately.

Your latest code would help me understand where your issue is.

Stupid question but have you tried looking at Output?

Can you also print between each lines to see whaty line the error occurs?

1 Like

Is the Handle still attached to the player and the rest of the tool is left in its original spot?

If so, then you need to weld them together.

Could you send an image of the Explorer showing the tool and it’s children/descendants?

I’m sure you have this already, but tool properties box should be checked under “RequiresHandle”.

Here is example code:
LocalScript:

print("Hello world!")

local player = game.Players.LocalPlayer
local character:Model = player.CharacterAdded:wait()
local humanoid:Humanoid = character:WaitForChild("Humanoid",10)
local RS = game:GetService("ReplicatedStorage")

local TERE:RemoteEvent = RS:WaitForChild("ToolEquipRE")
local ARE:RemoteEvent = RS:WaitForChild("ActivateRE")

-- Spawn a new part at TargetPoint when the tool is activated
function onActivated()
	ARE:FireServer(humanoid.TargetPoint)
end

-- Make a new tool when the LocalScript first runs
TERE:FireServer()

local tool:Tool = character:WaitForChild("Tool",5)
print(tool.Name)
-- Handle tool use
if tool then
	tool.Activated:Connect(onActivated)
end

Script:

local re = Instance.new("RemoteEvent")
re.Name = "ToolEquipRE"
re.Parent = RS

local are = Instance.new("RemoteEvent")
are.Name = "ActivateRE"
are.Parent = RS

-- Make a new tool and handle and put it in the player's Backpack
local function makeAndEquipTool(player,humanoid)
	-- Create tool
	local tool = Instance.new("Tool")
	-- Place tool in backpack
	tool.Parent = player:WaitForChild("Backpack")	
	-- Create tool handle
	local handle = Instance.new("Part")
	handle.Name = "Handle"
	handle.Parent = tool
	handle.BrickColor = BrickColor.Yellow()
	handle.Size=Vector3.new(.3,.3,4)
	local tip = Instance.new("Part")
	tip.TopSurface = Enum.SurfaceType.Smooth
	tip.BottomSurface = Enum.SurfaceType.Smooth
	tip.Shape = Enum.PartType.Ball
	tip.Size = Vector3.new(.4,.4,.4)
	tip.CFrame = handle.CFrame:ToWorldSpace(CFrame.new(0,0,-2))
	tip.BrickColor = BrickColor.Green()
	tip.Parent = handle
	local w = Instance.new("WeldConstraint")
	w.Part0 = handle
	w.Part1 = tip
	w.Parent = handle
	-- Enable and equip tool
	tool.Enabled = true
	humanoid:EquipTool(tool)

end

re.OnServerEvent:Connect(function(player)	
	makeAndEquipTool(player,player.Character.Humanoid)
end)

local function spawnPart(pos)
	local part = Instance.new("Part")
	part.Anchored = true
	part.Size = Vector3.new(1,1,1)
	part.Position = pos
	part.Parent = game.Workspace
	part.BrickColor = BrickColor.Blue()
	part.TopSurface = Enum.SurfaceType.Smooth
	part.BottomSurface = Enum.SurfaceType.Smooth
end

-- Create a new blue colored part at *pos* in the world
are.OnServerEvent:Connect(function(player,pos)
	spawnPart(pos)	
end)

Its a modified version of what is on the website for humanoid:EquipTool()

1 Like