Tool Deletion after use

Hello, I am trying to make a Tool destroy once you use it (Touch the tool to a part) I have a script but it doesn’t seem to work.

local Piece = game.Workspace.BrokenParts.RightWing

function onTouched(hit)
	wait(1)
	Tool.Unequipped = true
	Tool:Destroy()

connection = Piece.Touched:connect(onTouched)```
 Pls Help
Tool.Unequipped = true
	Tool:Destroy()

That makes it get deleted if you stop holding it.

I think you were trying to achieve for it to get deleted if you actually drop it, so you need to change that.

If this solved your problem, mark it as solution so other people don’t need to ask.

1 Like

Touched will fire with anything, including the player character.

Do this instead

local partToHit = game.workspace.Part -- the part you want to hit

script.Parent.Handle.Touched:Connect(function(hit)
   if hit == partToHit then
      wait(1)
      script.Parent:Destroy()
   end
end)
2 Likes

Ill let you know if this works