I've only been able to remove the items that the player has not been holding, so I was wondering how you could do this. Thank you!
✓ ANSWER ACCEPTED
How do you remove ALL Items from the inventory? (INCLUDING THE ONE THE PLAYER HAS EQUIPPED)
2 answers
✓ Accepted answer
To unequip any tools, use UnequipTools on the Humanoid.
To remove all items from the Backpack, run ClearAllChildren on it.
Character.Humanoid:UnequipTools()
Player.Backpack:ClearAllChildren()
In my example above, Player and Character must be defined in order for it to work as expected.
Well, when the player equips a tool, it is moved to their character. The best way to do this would be to first unequip the player's tools using the :UnequipTools() method of Humanoid. The complete code is below.
function ClearTools(plr) -- plr = Player object
plr.Character:WaitForChild("Humanoid"):UnequipTools()
for _, v in ipairs(plr.Backpack:GetChildren()) do
if v:IsA("BackpackItem") then -- Just incase you're using a (deprecated) HopperBin.
v:Destroy()
end
end
end
I hope my answer helped! If it solved your problem please remember to mark it as correct!
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
I wouldn't use :ClearAllChildren() because if a script is in there it will be destroyed.
Why would there be a script in the Backpack, or anything other than tools?
Also, he said in all caps he wants to remove all items.
I put scripts in the backpack more than I put tools in the backpack.