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?