PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Players

Show deprecated

Players

Show deprecated

The Players game service contains only Player objects for presently connected clients to a Roblox game server. It also contains information about a place’s configuration (such as bubble chat or classic chat). It can fetch information about players not connected to the server, such as character appearances, friends and avatar thumbnail.

Properties

bool

BubbleChat

[ReadOnly] [NotReplicated]

Indicates whether or not bubble chat is enabled. It is set with the Players/SetChatStyle method.

bool

CharacterAutoLoads

[NotReplicated]

Indicates whether Characters will respawn automatically.

bool

ClassicChat

[ReadOnly] [NotReplicated]

Indicates whether or not classic chat is enabled; set by the Players/SetChatStyle method.

Instance

LocalPlayer

[ReadOnly] [NotReplicated]

The Player that the LocalScript is running for.

int

MaxPlayers

[ReadOnly] [NotReplicated]

The maximum amount of players that can be in this server.

int

MaxPlayersInternal

Players/MaxPlayers for internal use.

int

PreferredPlayers

[ReadOnly] [NotReplicated]

The preferred amount of players for this server.

int

PreferredPlayersInternal

Players/PreferredPlayers for internal use.

float

RespawnTime

Controls the amount of time taken for a players character to respawn

Functions

void

Chat ( string message )

Makes the local player chat the given message

Instance

CreateLocalPlayer ( )

Used by the game to create the Player/LocalPlayer

Instance

GetCharacterAppearanceAsync ( int64 userId )

[Yields]

Returns a Model containing the assets which the player is wearing, excluding gear

Dictionary

GetCharacterAppearanceInfoAsync ( int64 userId )

[Yields]

Returns information about the character appearance of a given user

Instance

GetFriendsAsync ( int64 userId )

[Yields]

Returns a FriendPages object which contains information for all of the given player’s friends

Instance

GetHumanoidDescriptionFromOutfitId ( int64 outfitId )

[Yields]
Instance

GetHumanoidDescriptionFromUserId ( int64 userId )

[Yields]
string

GetNameFromUserIdAsync ( int64 userId )

[Yields]

Sends a query to the Roblox website for the username of an account with a given Player/UserId|UserId

Instance

GetPlayerByUserId ( int64 userId )

Returns the Player with the given Player/UserId|UserId if they are in-game

Instance

GetPlayerFromCharacter ( Instance character )

Returns the Player whose Player/Character|Character matches the given instance, or nil if one cannot be found

Objects

GetPlayers ( )

Returns a table of all presently connected Player objects

int64

GetUserIdFromNameAsync ( string userName )

[Yields]

Sends a query to the Roblox website for the Player/UserId|userId of an account with a given username

Tuple

GetUserThumbnailAsync ( int64 userId , ThumbnailType thumbnailType , ThumbnailSize thumbnailSize )

[Yields]

Returns the content URL of a player thumbnail given the size and type (avatar, bust, headshot), and a bool describing if the image is ready to be used

void

ReportAbuse ( Instance player , string reason , string optionalMessage )

Attempts to report the given player for the given reason

void

SetChatStyle ( ChatStyle style )

Sets whether BubbleChat and ClassicChat are being used, and tells TeamChat and Chat what to do.

void

TeamChat ( string message )

Makes the LocalPlayer chat the given message, which will only be viewable by users on the same team

void

WhisperChat ( string message , Instance player )

Delivers the given message to a recipient without anyone else seeing

Events

RBXScriptSignal

PlayerAdded ( Instance player )

Fires when a player enters the game.

RBXScriptSignal

PlayerChatted ( PlayerChatType chatType , Instance player , string message , Instance targetPlayer )

Fired when a player chats.

RBXScriptSignal

PlayerConnecting ( Instance player )

Fired when a player is connecting to the game.

RBXScriptSignal

PlayerDisconnecting ( Instance player )

Fired when a player is disconnecting from the game.

RBXScriptSignal

PlayerRejoining ( Instance player )

Fired when a player rejoins a game session after having disconnected prior.

RBXScriptSignal

PlayerRemoving ( Instance player )

Fires when a player is about to leave the game.