Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Head is not destroying?

Asked by
emite1000 335 Moderation Voter
10 years ago

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

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

2 answers

Log in to vote
0
Answered by 10 years ago

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)
0
Ah, that makes sense. But unfortunately that doesn't work either for some reason. Nothing happens, no error in output. emite1000 335 — 10y
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. giraffe73 5 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Try this

game.Workspace.Player.Head:Destroy()

EDITED!Should work

0
ROBLOX Wiki quote: "This item is deprecated. Do not use it for new work." emite1000 335 — 10y
0
What does that mean!? iluvmaths1123 198 — 10y
0
It means you are not supposed to use the :remove() method any more. Instead you should use :ClearAllChildren() or :Destroy(). emite1000 335 — 10y

Answer this question