Humanoid not unequipping tools

Hey developers!

I have a script that detects when a player has something in their cart and then, if they do, it equips a bag tool. This works all fine, but I am finding that Humanoid:UnequipTools() is not working. The backpack is disabled. Does anyone have a fix for this? Thanks!

Here is my code:

function UpdateBag(Player)
	if #Carts[Player.UserId] <= 0 then
		print("Unequipping tools") -- Prints when it's supposed to
		Player.Character.Humanoid:UnequipTools()
	else
		print("Equipping tool") -- Prints when it's supposed to
		Player.Character.Humanoid:EquipTool(game.ReplicatedStorage.Bag)
	end
end

Try this:

function UpdateBag(Player)
	if #Carts[Player.UserId] <= 0 then
		print("Unequipping tools") -- Prints when it's supposed to
		Player.Character.Humanoid:UnequipTools()
	else
		print("Equipping tool") -- Prints when it's supposed to
		local Tool = game.ReplicatedStorage.Bag:Clone() --Clone tool
		Tool.Parent = workspace --Place to workspace
		Player.Character.Humanoid:EquipTool(Tool) --equip
	end
end
2 Likes