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

Getting Character from player?

Asked by 10 years ago

I want to parent something into a players torso but I need to get the players character first.

I have heard of game.Players:GetPlayerFromCharacter(player)

How would I get the Character from the player?

1 answer

Log in to vote
7
Answered by 10 years ago

The Player object has a Character property. This leads to the Character of the Player (if the player has one). For example:

Game.Players.Players.PlayerAdded:connect(function(Player)
    repeat wait() until Player.Character --Wait until the Player has a character
    Player.Character:Destroy() --Destroy the character
end)
1
Adding to what Articulating said the character property is a reference to the players body parts, scripts, animation , clothing etc. Kozero 120 — 10y
2
Those are within the Character itself, yes. That isn't relevant to the question. Articulating 1335 — 10y
0
Okay. IntellectualBeing 430 — 10y
Ad

Answer this question