PlayerClient
A player's client instance. Inherits from the PlayerClient class. You can use this class to get information about the player, such as their Character and NetPlayer.
Player Class Hierarchy
The diagram shows the inheritance hierarchy of player-related classes. To navigate between classes:
- Get a
PlayerClient
usingPlayers.Local()
- Get the
NetPlayer
from aPlayerClient
using:GetNetPlayer()
- Get the
Player
from aNetPlayer
using:GetGamePlayer()
- Get the
Character
from aPlayer
using:GetCharacter()
Example usage:
local playerClient = Players.Local()
Class Instance Methods
Inherited Methods
From PlayerClient
:
PlayerClient:GetNetPlayer(): NetPlayer
Returns the NetPlayer associated with this PlayerClient.
PlayerClient:GetNick(): string
Returns the player's nickname as a string.
PlayerClient:GetSteamId(): string
Returns the player's Steam ID as a string.
PlayerClient:GetNetId(): number
Returns the player's network ID as a number.
PlayerClient:GetPing(): number
Returns the player's ping as a number.
Class Methods
PlayerClient:GetCharacter(): Character
Returns the Character associated with this PlayerClient.
PlayerClient:GetNetPlayer(): NetPlayer
Returns the NetPlayer associated with this PlayerClient.
PlayerClient:GetGamePlayer(): Player
Returns the Player associated with this PlayerClient.