Hi, I’m trying to make it to where when the player presses E near a block it will delete the tool the player is currently holding but leave the rest of the tools in the backpack. The only way I was able to delete the tool was to unequip the tool and delete all the tools from the backpack by putting this script inside a ProximityPrompt. How do I only delete the currently equipped tool? I’m still learning but I’m trying.
local prompt = script.Parent
prompt.Triggered:Connect(function(player)
local backpack = player.Backpack
local char = player.Character
if not char then return end
local hum = char.Humanoid
hum:UnequipTools()
wait()
for _,tool in pairs(backpack:GetChildren()) do
tool:Destroy()
end
end)