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

How do I get the player from the player character? [closed]

Asked by 10 years ago

I know how to get the character form the player but how do I get the player?

player = script.Parent.Parent
player.Character.Torso

but how would i get from the players character to the one in Players?

0
nvm, got it User#600 0 — 10y

Locked by adark, Perci1, SanityMan, and Shawnyg

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
2eggnog 981 Moderation Voter
10 years ago

I know you already found a solution, but just in case anyone else wanted to know, the Players service has a method called GetPlayerFromCharacter.

local character = game.Workspace.Player
local player = game.Players:GetPlayerFromCharacter(character)
0
And opposite that, the Character member of Player object is a reference to their Character Model, when it isn't `nil`. adark 5487 — 10y
Ad