I found this neat script on the developer forum here:

local itemName = "Cup" --Change this

if player.Backpack:FindFirstChild(itemName) and player.Backpack[itemName]:IsA("Tool") then
    player.Backpack.Cup:Destroy()
end --Destroy Non-Equipped tool in inventory / Backpack

if player.Character and player.Character:FindFirstChild(itemName) and player.Character[itemName]:IsA("Tool") then
    player.Character[itemName]:Destroy()
end --Destroy Equipped Tool

I have been looking for a script for long time that would not only destroy items in a player's backpack, but also on a player's character once it is equipped.

I'm trying to make a door that removes the equipped item and destroys it in the backpack, but I don't really know how to make this script activate once the door has been touched by a humanoid. Since the original answer was for a server script.

Could somebody help? Thanks in advance.