Why Humanoid:UnequipTools() and Humanoid:EquipTool() do not work?

Hi,
I have a script that should unequip tool and then equip tool that have a number values value called “Amount” more than 0, but for some reason this script do not unequip tools and do not equip new. I dont know why lol.

Heres script:

Checking.OnServerEvent:Connect(function(player)
	local character = player.Character
	for _, i in pairs(character:GetChildren()) do
		if i:IsA("Tool") then
	    	if i:WaitForChild("Amount").Value <= 0 then
				print("Checked1") -- prints!!!
	        	character.Humanoid:UnequipTools()
	        	for _, v in pairs(player:WaitForChild("Backpack"):GetChildren()) do
		       	 	if v:WaitForChild("Amount").Value >= 0 then
						character.Humanoid:EquipTool(v)
						print("Checked2") -- prints!!!
		       		end
	       		end
	    	end
		end
    end
end)

everything prints so script work it just do not equip new tool/ not unequipping old. Any thoughts?

So do the both prints work? And not the equip and unequip

yes it prints and tool do not changing :frowning:

Can you show me the tool v with any of its children

Also is this local or server script?

server script. I don’t know what do you mean exactly but heres what inside the tool
https://gyazo.com/67a0ad843f0dfd772d04ffca077ef209
3 values is a numbervalue

Try to fire a client event to a local script placed somewhere in Starter GUI or StarterCharacterScript and when the client gets the event then it will run the equip or the unequip tool in the local script

nvm i fixed script. i put “>= 0” and this mean that script was equipping the same tool with 0 “Amount” i removed “=” and now it work.