Roblox Wiki
Advertisement
Roblox Wiki

The Players class inherits from Instance. It is what holds connected Player light iconPlayer dark iconPlayer objects.

Properties

BubbleChat: bool

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
This API member has existing documentation in this page's Member list template.
This class member is missing documentation. Create or add to its subpage at Class:Players/BubbleChat.
  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

CharacterAutoLoads: bool

  • Not replicatedThis member is not replicated across the network boundary.
This class member is missing documentation. Create or add to its subpage at Class:Players/CharacterAutoLoads.
  • Category: Behavior.
  • Serialization: can save and load.
  • Thread safety: read safe

ClassicChat: bool

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
This class member is missing documentation. Create or add to its subpage at Class:Players/ClassicChat.
  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

LocalPlayer: Player

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.

Contains a reference to the local player on the client. This property will only reference a player if referenced by a LocalScript light iconLocalScript dark iconLocalScript- this property will never have a value on the server (when executed by Script light iconScript dark iconScripts).

  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

MaxPlayers: int

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.

Determines the maximum amount of Player light iconPlayer dark iconPlayers that can play simultaneously per-server. This property is read-only, but will always match the value that is declared in place settings.

  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

MaxPlayersInternal: int

  • HiddenThis property is not shown in the object browser and properties window.
This class member is missing documentation. Create or add to its subpage at Class:Players/MaxPlayersInternal.
  • Category: Data.
  • Read security: LocalUserSecurity.
  • Write security: LocalUserSecurity.
  • Serialization: can save and load.
  • Thread safety: read safe

NumPlayers: int

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
  • DeprecatedThis member will be phased out and should be avoided while it is still available.

Use #game:GetService("Players"):GetPlayers() instead.

  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

PreferredPlayers: int

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
This class member is missing documentation. Create or add to its subpage at Class:Players/PreferredPlayers.
  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

PreferredPlayersInternal: int

  • HiddenThis property is not shown in the object browser and properties window.
This class member is missing documentation. Create or add to its subpage at Class:Players/PreferredPlayersInternal.
  • Category: Data.
  • Read security: LocalUserSecurity.
  • Write security: LocalUserSecurity.
  • Serialization: can save and load.
  • Thread safety: read safe

RespawnTime: float

Determines the amount of seconds that a Player light iconPlayer dark iconPlayer will remain dead until they will automatically respawn.

  • Category: Data.
  • Serialization: can save and load.
  • Thread safety: read safe

UseStrafingAnimations: bool

  • Not scriptableThis member cannot be accessed by Lua code.
This class member is missing documentation. Create or add to its subpage at Class:Players/UseStrafingAnimations.
  • Category: Behavior.
  • Serialization: can save and load.
  • Thread safety: read safe

localPlayer: Player

  • HiddenThis property is not shown in the object browser and properties window.
  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
  • DeprecatedThis member will be phased out and should be avoided while it is still available.

Use LocalPlayer instead.

  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

numPlayers: int

  • HiddenThis property is not shown in the object browser and properties window.
  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
  • DeprecatedThis member will be phased out and should be avoided while it is still available.

Use #game:GetService("Players"):GetPlayers() instead.

  • Category: Data.
  • Serialization: cannot load or save.
  • Thread safety: read safe

Methods

Chat(message: string): null

Parameters
NameType
messagestring
  • Security: PluginSecurity.
  • Thread safety: unsafe

CreateHumanoidModelFromDescription(description: HumanoidDescription, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default): Model

  • YieldsThis function can yield the script it is used in.
Parameters
NameTypeDefault
descriptionHumanoidDescription
rigTypeHumanoidRigType
assetTypeVerificationAssetTypeVerificationDefault
  • Thread safety: unsafe

CreateHumanoidModelFromUserId(userId: int64): Model

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64
  • Thread safety: unsafe

CreateLocalPlayer(): Player

This class member is missing documentation. Create or add to its subpage at Class:Players/CreateLocalPlayer.
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

GetCharacterAppearanceAsync(userId: int64): Model

  • YieldsThis function can yield the script it is used in.
  • DeprecatedThis member will be phased out and should be avoided while it is still available.
Parameters
NameType
userIdint64
  • Thread safety: unsafe

GetCharacterAppearanceInfoAsync(userId: int64): Dictionary

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64
  • Thread safety: unsafe

GetFriendsAsync(userId: int64): FriendPages

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64

Returns a FriendPages object containing every friend of this player. Each item in the pages object is a table consisting of the following values.

Key Type Description
Id int The Player light iconPlayer dark iconPlayer.UserId of the player.
Username string The username of the player.
DisplayName string The display name of the player.
IsOnline boolean Whether or not the player is currently online.
  • Thread safety: unsafe

GetHumanoidDescriptionFromOutfitId(outfitId: int64): HumanoidDescription

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
outfitIdint64
  • Thread safety: unsafe

GetHumanoidDescriptionFromUserId(userId: int64): HumanoidDescription

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64
  • Thread safety: unsafe

GetNameFromUserIdAsync(userId: int64): string

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64
  • Thread safety: unsafe

GetPlayerByUserId(userId: int64): Player

Parameters
NameType
userIdint64
  • Thread safety: safe

GetPlayerFromCharacter(character: Model): Player

Parameters
NameType
characterModel
  • Thread safety: unsafe

GetPlayers(): Objects

Returns an array of Player light iconPlayer dark iconPlayers in the server. This method is functionally identical to Instance:GetChildren, except this method filters out all non-Player objects within the Players service.

  • Thread safety: safe

GetUserIdFromNameAsync(userName: string): int64

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userNamestring
  • Thread safety: unsafe

GetUserThumbnailAsync(userId: int64, thumbnailType: ThumbnailType, thumbnailSize: ThumbnailSize): Tuple

  • YieldsThis function can yield the script it is used in.
Parameters
NameType
userIdint64
thumbnailTypeThumbnailType
thumbnailSizeThumbnailSize
  • Thread safety: unsafe

ReportAbuse(player: Player, reason: string, optionalMessage: string): null

Parameters
NameType
playerPlayer
reasonstring
optionalMessagestring
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

ReportAbuseV3(player: Player, jsonTags: string): null

Parameters
NameType
playerPlayer
jsonTagsstring
  • Security: RobloxScriptSecurity.
  • Thread safety: unsafe

ResetLocalPlayer(): null

This class member is missing documentation. Create or add to its subpage at Class:Players/ResetLocalPlayer.
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

SetChatStyle(style: ChatStyle = Classic): null

Parameters
NameTypeDefault
styleChatStyleClassic
  • Security: PluginSecurity.
  • Thread safety: unsafe

SetLocalPlayerInfo(userId: int64, userName: string, displayName: string, membershipType: MembershipType, isUnder13: bool): null

Parameters
NameType
userIdint64
userNamestring
displayNamestring
membershipTypeMembershipType
isUnder13bool
  • Security: RobloxScriptSecurity.
  • Thread safety: unsafe

TeamChat(message: string): null

Parameters
NameType
messagestring
  • Security: PluginSecurity.
  • Thread safety: unsafe

WhisperChat(message: string, player: Instance): null

Parameters
NameType
messagestring
playerInstance
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

getPlayers(): Objects

  • DeprecatedThis member will be phased out and should be avoided while it is still available.

This member is deprecated. Please use GetPlayers instead.

  • Thread safety: unsafe

playerFromCharacter(character: Model): Player

  • DeprecatedThis member will be phased out and should be avoided while it is still available.
Parameters
NameType
characterModel

Use GetPlayerFromCharacter instead.

  • Thread safety: unsafe

players(): Objects

  • DeprecatedThis member will be phased out and should be avoided while it is still available.

Use GetPlayers instead.

  • Thread safety: unsafe

Events

FriendRequestEvent(player: Player, player: Player, friendRequestEvent: FriendRequestEvent)

Parameters
NameType
playerPlayer
playerPlayer
friendRequestEventFriendRequestEvent
  • Security: RobloxScriptSecurity.
  • Thread safety: unsafe

GameAnnounce(message: string)

Parameters
NameType
messagestring
  • Security: RobloxScriptSecurity.
  • Thread safety: unsafe

PlayerAdded(player: Player)

Parameters
NameType
playerPlayer

Fired when a Player light iconPlayer dark iconPlayer connects to the server.

  • Thread safety: unsafe

PlayerChatted(chatType: PlayerChatType, player: Player, message: string, targetPlayer: Player)

Parameters
NameType
chatTypePlayerChatType
playerPlayer
messagestring
targetPlayerPlayer
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

PlayerConnecting(player: Player)

Parameters
NameType
playerPlayer
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

PlayerDisconnecting(player: Player)

Parameters
NameType
playerPlayer
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

PlayerMembershipChanged(player: Player)

Parameters
NameType
playerPlayer
  • Thread safety: unsafe

PlayerRejoining(player: Player)

Parameters
NameType
playerPlayer
  • Security: LocalUserSecurity.
  • Thread safety: unsafe

PlayerRemoving(player: Player)

Parameters
NameType
playerPlayer

Fired immediately before a Player light iconPlayer dark iconPlayer is disconnected from the server.

  • Thread safety: unsafe

UserSubscriptionStatusChanged(user: Player, subscriptionId: string)

This class member is missing documentation. Create or add to its subpage at Class:Players/UserSubscriptionStatusChanged.
  • Thread safety: unsafe

Removed members

Methods

  • AddLeaderboardKey
  • BlockUser
  • GetPlayerById
  • GetPlayerByID
  • getPlayerFromCharacter
  • GetUseCoreScriptHealthBar
  • SetAbuseReportUrl
  • SetBuildToolsUrl
  • SetBuildUserPermissionsUrl
  • SetChatFilterUrl
  • SetLoadDataUrl
  • SetSaveDataUrl
  • SetSaveLeaderboardDataUrl
  • SetSysStatsUrl
  • SetSysStatsUrlId
  • UnblockUser

Events

  • PlayerAddedEarly
  • PlayerRemovingLate

External links[]

Advertisement