Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Head is not destroying?

In this script, why is the head not being destroyed?

game.Players.PlayerAdded:connect(function(player)
	player:WaitForDataReady()
	player.Head:Destroy()
	end)

2 answers

You can't get the head from the player, you must get it from character. For example. (In a local script inside the starterpack)

game.Players.PlayerAdded:connect(function(player)
	player:WaitForDataReady()
	player.Character.Head:Destroy()
end)

2 comments

0

Ah, that makes sense. But unfortunately that doesn't work either for some reason. Nothing happens, no error in output.

0

Oh sorrym this isn't supposed to be in a LocalScript. I was going to do another script for you in a local script, but I changed my mind, this should be in the Workspace in a normal script.

Try this

game.Workspace.Player.Head:Destroy()

EDITED!Should work

3 comments

0

ROBLOX Wiki quote: "This item is deprecated. Do not use it for new work."

0

What does that mean!?

0

It means you are not supposed to use the :remove() method any more. Instead you should use :ClearAllChildren() or :Destroy().

This discussion is preserved as it was. New answers, comments, and votes are closed.