Script Works until i go to a part that destroys a tool

I’m making a game that has tools in it so when you use the tool on a part and the part destroys it the script doesn’t work anymore keep in mind that it’s not a tool from the starter pack its a union welded to your hand when you click it and the point of the script is that it’s anchored but when I click it it becomes unanchored, here’s my script:

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local tool = game.Workspace.tool
character:WaitForChild(“tool”) character.tool.Anchored = false
end)
end)

1 Like

So where is this script located. If this script is destroyed or removed than it wont work or do anything because it isn’t there.

The script is located in the workspace and the tool is being destroyed not the script

Oh and i dont know if i mentioned this but once you use the tool and try picking up another one the others are still anchored thats was the problem i was trying to address