script.Parent.ClickDetector.MouseClick:connect(function(player) player.Head:remove() end)
The problem is that the player
is the player in players
not the character
in workspace
so instead do
script.Parent.ClickDetector.MouseClick:connect(function(player) player.Character.Head:remove() end)