PlayerFromCharacter (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
No edit summary
>MrNicNac
Added an example of the method.
Line 8: Line 8:


{{clear floats}}
{{clear floats}}
{{Example|You give this function a model, and it will return the player if the model is the character of that player, or nil.
<pre>
local Player = Game.Players:PlayerFromCharacter( Workspace.Player )
print(Player)
>Player
</pre>
}}


[[Category:Methods]]
[[Category:Methods]]

Revision as of 17:37, 24 December 2010

PlayerFromCharacter( Instance character )
Returns Player object which is controlling the character.
Description: Gives you the player from that player's character.
Member of: Players


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