✓ Accepted answer
Normally you should tell us not only the error, but what line it occurred on.
metalicurt is correct, you need to have Head in quotes.
However, the script will run before the Tool is parented to the player's character. You should get the head only when the tool is activated or equipped (unless you use game.Players.LocalPlayer.Character)
Also, remember to use descriptive variable names (this is more important in larger scripts). A fixed script:
local tool = script.Parent.Parent
function RemoveHead()
local head = tool.Parent:FindFirstChild("Head")
if head then
head:Destroy()
end
end
tool.Activated:Connect(RemoveHead)
Note that it checks for the head each time it is activated and won't error if the head isn't there (ex. because the script ran already).
1 comment
Use :Destroy() not delete!