Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

Getting Character from player?

Asked by 6 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 6 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 — 6y
2
Those are within the Character itself, yes. That isn't relevant to the question. Articulating 1330 — 6y
0
Okay. IntellectualBeing 430 — 6y
Ad

Answer this question