PlayerFromCharacter (Method)
From Legacy Roblox Wiki
PlayerFromCharacter( Instance character ) | |
Returns | Player object which is controlling the character. |
Description: | Gives you the player from that player's character. |
Member of: | Players |
Please Note: When using this method in places, it's name must be in camelCase.
Example
You give this function a model, and it will return the player if the model is the character of that player, or nil.
local Player = Game.Players:playerFromCharacter( Workspace.Player ) print(Player) >Player