Players
A service that contains presently connected Player objects.
Memory category | Instances |
---|
Member index 66
Removed member index 19
History | Member | |
---|---|---|
258 | AddLeaderboardKey(key: string): void | |
284 | BlockUser(blockerUserId: int, blockeeUserId: int): string | |
310 | GetPlayerByID(userID: int): Instance | |
310 | GetPlayerById(userId: int): Instance | |
310 | GetUseCoreScriptHealthBar(): bool | |
310 | SetAbuseReportUrl(url: string): void | |
51 | SetBuildToolsUrl(url: string): void | |
310 | SetBuildUserPermissionsUrl(url: string): void | |
310 | SetChatFilterUrl(url: string): void | |
310 | SetLoadDataUrl(url: string): void | |
310 | SetSaveDataUrl(url: string): void | |
258 | SetSaveLeaderboardDataUrl(url: string): void | |
310 | SetSysStatsUrl(url: string): void | |
310 | SetSysStatsUrlId(urlId: string): void | |
284 | UnblockUser(exblockerUserId: int, exblockeeUserId: int): string | |
480 | getPlayerFromCharacter(character: Instance): Instance | |
310 | PlayerAddedEarly(player: Instance) | |
310 | PlayerRemovingLate(player: Instance) |
Description
History 273
- 651 Add BanningEnabled
- 648 Change ReturnType of players from Objects to Instances
- 648 Change ReturnType of getPlayers from Objects to Instances
- 648 Change ReturnType of GetPlayers from Objects to Instances
- 643 Add
- 643 Add ReportChatAbuse
- 629 Remove
- 625 Add GetBanHistoryAsync
- 622 Add UnbanAsync
- 622 Add BanAsync
- 594 Change Security of UserSubscriptionStatusChanged from RobloxScriptSecurity to None
- 590 Add UserSubscriptionStatusChanged
- 578 Change Tags of UseStrafingAnimations from [NotReplicated, NotScriptable] to [NotScriptable]
- 573 Change ReturnType of WhisperChat from void to null
- 573 Change ReturnType of TeamChat from void to null
- 573 Change ReturnType of SetLocalPlayerInfo from void to null
- 573 Change ReturnType of SetChatStyle from void to null
- 573 Change ReturnType of ResetLocalPlayer from void to null
- 573 Change ReturnType of ReportAbuseV3 from void to null
- 573 Change ReturnType of ReportAbuse from void to null
- 573 Change ReturnType of Chat from void to null
- 567 Add
- 567 Change ThreadSafety of GetPlayerByUserId from Unsafe to Safe
- 565 Add ResetLocalPlayer
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Add
- 553 Change PreferredDescriptor of players from to GetPlayers
- 553 Change PreferredDescriptor of playerFromCharacter from to GetPlayerFromCharacter
- 553 Change PreferredDescriptor of getPlayers from to GetPlayers
- 553 Change PreferredDescriptor of from to NumPlayers
- 553 Change Default of from to
- 553 Change PreferredDescriptor of from to LocalPlayer
- 553 Change Default of from to
- 553 Add UseStrafingAnimations
- 553 Add
- 553 Add
- 553 Change Default of RespawnTime from to
- 553 Change Default of from to
- 553 Change Default of PreferredPlayers from to
- 553 Change PreferredDescriptor of NumPlayers from to GetPlayers
- 553 Change Default of NumPlayers from to
- 553 Change Default of from to
- 553 Change Default of MaxPlayers from to
- 553 Change Default of LocalPlayer from to
- 553 Change Default of ClassicChat from to
- 553 Change Default of CharacterAutoLoads from to
- 553 Change Default of BubbleChat from to
- 540 Add ReportAbuseV3
- 533 Change ThreadSafety of GetPlayers from Unsafe to Safe
- 498 Change Parameters of PlayerRejoining from (player: Instance) to (player: Player)
- 498 Change Parameters of PlayerMembershipChanged from (player: Instance) to (player: Player)
- 498 Change Parameters of PlayerDisconnecting from (player: Instance) to (player: Player)
- 498 Change Parameters of PlayerConnecting from (player: Instance) to (player: Player)
- 498 Change Parameters of PlayerChatted from (chatType: PlayerChatType, player: Instance, message: string, targetPlayer: Instance) to (chatType: PlayerChatType, player: Player, message: string, targetPlayer: Player)
- 498 Change Parameters of ReportAbuse from (player: Instance, reason: string, optionalMessage: string) to (player: Player, reason: string, optionalMessage: string)
- 498 Change ReturnType of GetHumanoidDescriptionFromUserId from Instance to HumanoidDescription
- 498 Change ReturnType of GetHumanoidDescriptionFromOutfitId from Instance to HumanoidDescription
- 498 Change ReturnType of GetFriendsAsync from Instance to FriendPages
- 498 Change ReturnType of GetCharacterAppearanceAsync from Instance to Model
- 498 Change ReturnType of CreateLocalPlayer from Instance to Player
- 498 Change ReturnType of CreateHumanoidModelFromUserId from Instance to Model
- 498 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default) to (description: HumanoidDescription, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 498 Change ReturnType of CreateHumanoidModelFromDescription from Instance to Model
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of RespawnTime from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of PreferredPlayers from ReadOnly to ReadSafe
- 486 Change ThreadSafety of NumPlayers from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxPlayers from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LocalPlayer from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ClassicChat from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CharacterAutoLoads from ReadOnly to ReadSafe
- 486 Change ThreadSafety of BubbleChat from ReadOnly to ReadSafe
- 483 Change Parameters of PlayerRemoving from (player: Instance) to (player: Player)
- 483 Change Parameters of PlayerAdded from (player: Instance) to (player: Player)
- 483 Change Parameters of FriendRequestEvent from (player: Instance, player: Instance, friendRequestEvent: FriendRequestEvent) to (player: Player, player: Player, friendRequestEvent: FriendRequestEvent)
- 483 Change Parameters of playerFromCharacter from (character: Instance) to (character: Model)
- 483 Change ReturnType of playerFromCharacter from Instance to Player
- 483 Change Parameters of GetPlayerFromCharacter from (character: Instance) to (character: Model)
- 483 Change ReturnType of GetPlayerFromCharacter from Instance to Player
- 483 Change ReturnType of GetPlayerByUserId from Instance to Player
- 481 Change Tags of GetCharacterAppearanceAsync from [Yields] to [Yields, Deprecated]
- 480 Remove getPlayerFromCharacter
- 469 Change Tags of from [] to [Hidden]
- 469 Change Tags of from [] to [Hidden]
- 462 Change ThreadSafety of PlayerRemoving from to Unsafe
- 462 Change ThreadSafety of PlayerRejoining from to Unsafe
- 462 Change ThreadSafety of PlayerMembershipChanged from to Unsafe
- 462 Change ThreadSafety of PlayerDisconnecting from to Unsafe
- 462 Change ThreadSafety of PlayerConnecting from to Unsafe
- 462 Change ThreadSafety of PlayerChatted from to Unsafe
- 462 Change ThreadSafety of PlayerAdded from to Unsafe
- 462 Change ThreadSafety of GameAnnounce from to Unsafe
- 462 Change ThreadSafety of FriendRequestEvent from to Unsafe
- 462 Change ThreadSafety of players from to Unsafe
- 462 Change ThreadSafety of playerFromCharacter from to Unsafe
- 462 Change ThreadSafety of getPlayers from to Unsafe
- 462 Change ThreadSafety of getPlayerFromCharacter from to Unsafe
- 462 Change ThreadSafety of WhisperChat from to Unsafe
- 462 Change ThreadSafety of TeamChat from to Unsafe
- 462 Change ThreadSafety of SetLocalPlayerInfo from to Unsafe
- 462 Change ThreadSafety of SetChatStyle from to Unsafe
- 462 Change ThreadSafety of ReportAbuse from to Unsafe
- 462 Change ThreadSafety of GetUserThumbnailAsync from to Unsafe
- 462 Change ThreadSafety of GetUserIdFromNameAsync from to Unsafe
- 462 Change ThreadSafety of GetPlayers from to Unsafe
- 462 Change ThreadSafety of GetPlayerFromCharacter from to Unsafe
- 462 Change ThreadSafety of GetPlayerByUserId from to Unsafe
- 462 Change ThreadSafety of GetNameFromUserIdAsync from to Unsafe
- 462 Change ThreadSafety of GetHumanoidDescriptionFromUserId from to Unsafe
- 462 Change ThreadSafety of GetHumanoidDescriptionFromOutfitId from to Unsafe
- 462 Change ThreadSafety of GetFriendsAsync from to Unsafe
- 462 Change ThreadSafety of GetCharacterAppearanceInfoAsync from to Unsafe
- 462 Change ThreadSafety of GetCharacterAppearanceAsync from to Unsafe
- 462 Change ThreadSafety of CreateLocalPlayer from to Unsafe
- 462 Change ThreadSafety of CreateHumanoidModelFromUserId from to Unsafe
- 462 Change ThreadSafety of CreateHumanoidModelFromDescription from to Unsafe
- 462 Change ThreadSafety of Chat from to Unsafe
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of RespawnTime from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of PreferredPlayers from to ReadOnly
- 462 Change ThreadSafety of NumPlayers from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of MaxPlayers from to ReadOnly
- 462 Change ThreadSafety of LocalPlayer from to ReadOnly
- 462 Change ThreadSafety of ClassicChat from to ReadOnly
- 462 Change ThreadSafety of CharacterAutoLoads from to ReadOnly
- 462 Change ThreadSafety of BubbleChat from to ReadOnly
- 454 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType) to (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 454 Change ValueType of from Instance to Player
- 454 Change ValueType of LocalPlayer from Instance to Player
- 452 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default) to (description: Instance, rigType: HumanoidRigType)
- 452 Change ValueType of from Player to Instance
- 452 Change ValueType of LocalPlayer from Player to Instance
- 453 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType) to (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 453 Change ValueType of from Instance to Player
- 453 Change ValueType of LocalPlayer from Instance to Player
- 443 Change Security of CreateHumanoidModelFromUserId from RobloxScriptSecurity to None
- 443 Change Security of CreateHumanoidModelFromDescription from RobloxScriptSecurity to None
- 442 Change Security of CreateHumanoidModelFromUserId from None to RobloxScriptSecurity
- 442 Change Security of CreateHumanoidModelFromDescription from None to RobloxScriptSecurity
- 443 Change Security of CreateHumanoidModelFromUserId from RobloxScriptSecurity to None
- 443 Change Security of CreateHumanoidModelFromDescription from RobloxScriptSecurity to None
- 427 Change Parameters of SetLocalPlayerInfo from (userId: int64, userName: string, membershipType: MembershipType, isUnder13: bool) to (userId: int64, userName: string, displayName: string, membershipType: MembershipType, isUnder13: bool)
- 416 Add PlayerMembershipChanged
- 377 Add CreateHumanoidModelFromUserId
- 377 Add CreateHumanoidModelFromDescription
- 374 Add SetLocalPlayerInfo
- 371 Add RespawnTime
- 369 Add GetHumanoidDescriptionFromUserId
- 369 Add GetHumanoidDescriptionFromOutfitId
- 329 Change ValueType of from Object to Instance
- 329 Change ValueType of LocalPlayer from Object to Instance
- 323 Change Parameters of GetUserThumbnailAsync from (userId: int, thumbnailType: ThumbnailType, thumbnailSize: ThumbnailSize) to (userId: int64, thumbnailType: ThumbnailType, thumbnailSize: ThumbnailSize)
- 323 Change ReturnType of GetUserIdFromNameAsync from int to int64
- 323 Change Parameters of GetNameFromUserIdAsync from (userId: int) to (userId: int64)
- 323 Change Parameters of GetFriendsAsync from (userId: int) to (userId: int64)
- 322 Change Parameters of GetCharacterAppearanceInfoAsync from (userId: int) to (userId: int64)
- 322 Change Parameters of GetCharacterAppearanceAsync from (userId: int) to (userId: int64)
- 319 Change Parameters of GetPlayerByUserId from (userId: int) to (userId: int64)
- 310 Remove PlayerRemovingLate
- 310 Remove PlayerAddedEarly
- 310 Remove SetSysStatsUrlId
- 310 Remove SetSysStatsUrl
- 310 Remove SetSaveDataUrl
- 310 Remove SetLoadDataUrl
- 310 Remove SetChatFilterUrl
- 310 Remove SetBuildUserPermissionsUrl
- 310 Remove SetAbuseReportUrl
- 310 Remove GetUseCoreScriptHealthBar
- 310 Remove GetPlayerById
- 310 Remove GetPlayerByID
- 310 Change Security of CreateLocalPlayer from PluginSecurity to LocalUserSecurity
- 310 Change Parameters of CreateLocalPlayer from (userId: int, isTeleport: bool = false) to ()
- 306 Add GetCharacterAppearanceInfoAsync
- 292 Change Tags of NumPlayers from [ReadOnly, NotReplicated] to [ReadOnly, NotReplicated, Deprecated]
- 287 Add GetUserThumbnailAsync
- 285 Remove GetUserThumbnailAsync
- 286 Add GetUserThumbnailAsync
- 285 Remove GetUserThumbnailAsync
- 286 Add GetUserThumbnailAsync
- 284 Remove UnblockUser
- 284 Remove BlockUser
- 272 Add PlayerRejoining
- 272 Add PlayerDisconnecting
- 272 Add PlayerConnecting
- 258 Remove SetSaveLeaderboardDataUrl
- 258 Remove AddLeaderboardKey
- 257 Add SetSaveLeaderboardDataUrl
- 257 Add AddLeaderboardKey
- 258 Remove SetSaveLeaderboardDataUrl
- 258 Remove AddLeaderboardKey
- 215 Change Parameters of CreateLocalPlayer from (userId: int) to (userId: int, isTeleport: bool = false)
- 212 Add GetCharacterAppearanceAsync
- 210 Add GetPlayerById
- 210 Change Tags of GetPlayerByID from [] to [Deprecated]
- 209 Add
- 209 Add PreferredPlayers
- 209 Add
- 209 Change WriteSecurity of MaxPlayers from RobloxSecurity to None
- 209 Change Tags of MaxPlayers from [NotReplicated] to [ReadOnly, NotReplicated]
- 209 Change ReadSecurity of MaxPlayers from RobloxSecurity to None
- 204 Add GetFriendsAsync
- 202 Add GetUserIdFromNameAsync
- 202 Add GetPlayerByUserId
- 202 Add GetNameFromUserIdAsync
- 200 Change Tags of LocalPlayer from [Hidden, ReadOnly, NotReplicated] to [ReadOnly, NotReplicated]
- 181 Add UnblockUser
- 181 Add BlockUser
- 151 Change Security of TeamChat from LocalUserSecurity to PluginSecurity
- 151 Change Security of SetChatStyle from LocalUserSecurity to PluginSecurity
- 151 Change Security of CreateLocalPlayer from LocalUserSecurity to PluginSecurity
- 151 Change Security of Chat from LocalUserSecurity to PluginSecurity
- 142 Add GetUseCoreScriptHealthBar
- 83 Change Security of PlayerChatted from RobloxScriptSecurity to LocalUserSecurity
- 83 Change Security of WhisperChat from RobloxScriptSecurity to LocalUserSecurity
- 83 Change Security of TeamChat from RobloxScriptSecurity to LocalUserSecurity
- 83 Change Security of ReportAbuse from RobloxScriptSecurity to LocalUserSecurity
- 83 Change Security of Chat from RobloxScriptSecurity to LocalUserSecurity
- 71 Change Parameters of FriendRequestEvent from (player: Instance, player: Instance, FriendRequestEvent: FriendRequestEvent) to (player: Instance, player: Instance, friendRequestEvent: FriendRequestEvent)
- 61 Add
- 55 Add CharacterAutoLoads
- 51 Remove SetBuildToolsUrl
- 50 Add
- 49 Change Tags of playerFromCharacter from [] to [Deprecated]
- 49 Add getPlayers
- 49 Add getPlayerFromCharacter
- 47 Add PlayerRemovingLate
- 47 Add PlayerRemoving
- 47 Add PlayerChatted
- 47 Add PlayerAddedEarly
- 47 Add PlayerAdded
- 47 Add GameAnnounce
- 47 Add FriendRequestEvent
- 47 Add players
- 47 Add playerFromCharacter
- 47 Add WhisperChat
- 47 Add TeamChat
- 47 Add SetSysStatsUrlId
- 47 Add SetSysStatsUrl
- 47 Add SetSaveLeaderboardDataUrl
- 47 Add SetSaveDataUrl
- 47 Add SetLoadDataUrl
- 47 Add SetChatStyle
- 47 Add SetChatFilterUrl
- 47 Add SetBuildUserPermissionsUrl
- 47 Add SetBuildToolsUrl
- 47 Add SetAbuseReportUrl
- 47 Add ReportAbuse
- 47 Add GetPlayers
- 47 Add GetPlayerFromCharacter
- 47 Add GetPlayerByID
- 47 Add CreateLocalPlayer
- 47 Add Chat
- 47 Add AddLeaderboardKey
- 47 Add NumPlayers
- 47 Add MaxPlayers
- 47 Add LocalPlayer
- 47 Add ClassicChat
- 47 Add BubbleChat
- 47 Add Players
Members 66
BanAsync
Parameters (1) | ||
---|---|---|
config | Dictionary | |
Returns (1) | ||
null |
The Players:BanAsync() method allows you to easily ban users who violate your experience's guidelines. You can specify the ban duration, enable the ban to propagate to suspected alternate accounts, and provide a message to the banned user in accordance with the Usage Guidelines. You should also post your experience rules somewhere accessible to all users and provide a way for them to appeal. This method is enabled and disabled by the Players.BanningEnabled property, which you can toggle in Studio.
Banning and Messaging
Banned users will be immediately evicted and prevented from rejoining your
experiences. They will be presented with an error modal displaying the
time left on their ban and your DisplayReason
. Roblox's backend systems
will evict players across all servers from the place(s) that you specify.
DisplayReason
can have a maximum length of 400 characters and is subject
to a text filter. For more information on acceptable modal text, see
ban messaging.
Places and Universe
By default, bans extend to any place within that universe. To limit the
ban to only the place from which this API is called, configure
ApplyToUniverse
to false
. However, if a user is banned in the start
place of the universe, it effectively results in the user being excluded
from the entirety of the universe, irrespective of whether a universal ban
is in place or not.
Alternative Accounts
Users often play under multiple different accounts, known as alternate
accounts or alt accounts, which are sometimes used to circumvent account
bans. To help you keep banned users out, the default behavior of this API
will propagate all bans from the source account you banned to any of their
suspected alt accounts. You can turn off ban propagations to alt accounts
by configuring ExcludeAltAccounts
to true
.
Ban Duration
Not all transgressions are the same, so not all bans should be the same
length. This API lets you configure the duration of the ban, in seconds,
with the Duration
field. To specify a permanent ban, set the field to
-1
. You may also want to dynamically configure the ban duration based on
the user's ban history, which you can query for using
Players:GetBanHistoryAsync(). For example, you may want to
consider the number of bans, the duration of previous bans, or build logic
off of the notes you save under PrivateReason
which can be up to 1000
characters and are not text filtered. PrivateReason
notes are never
shared with the client and can be considered safe from attackers.
Errors and Throttling
This method invokes an HTTP call to backend services which are subject to throttling and may fail. If you're calling this API with more than one UserId, this method will attempt to make the HTTP call for each ID. It will then aggregate any error messages and join them as a comma separated list. For example, if this method is invoked for five users and requests for those with UserIds 2 and 4 fail, the following error message appears:
HTTP failure for UserId 2: Timedout, HTTP 504 (Service unavailable) failure for UserId 4: Service exception
The message will always include failure for UserId {}
if it is an HTTP
error.
Client-Side Requirement
Because of the risks associated with banning users, this method may only be called on the backend experience server (client-side calls will result in an error). You may test this API in Studio, during collaborative creation, or in a team test, but the bans will not apply to production.
This API uses the User Restrictions Open Cloud API. You will be able to utilize these APIs to manage your bans in third party applications.
Thread safety | Unsafe |
---|
BanningEnabled
Type | Default | |
---|---|---|
bool |
Enables or disables the three Players methods (BanAsync(), UnbanAsync(), and GetBanHistoryAsync()) that constitute the ban API. This property is not scriptable and can only be modified in Studio.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 1
- 651 Add BanningEnabled
BubbleChat
Type | Default | |
---|---|---|
bool |
This property indicates whether or not bubble chat is enabled. It is set with the Players:SetChatStyle() method using the ChatStyle enum.
When this chat mode is enabled, the game displays chats in the chat user interface at the top-left corner of the screen.
There are two other chat modes, Players.ClassicChat and a chat mode where both classic and bubble chat are enabled.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of BubbleChat from to
- 486 Change ThreadSafety of BubbleChat from ReadOnly to ReadSafe
- 462 Change ThreadSafety of BubbleChat from to ReadOnly
- 47 Add BubbleChat
CharacterAutoLoads
Type | Default | |
---|---|---|
bool |
This property indicates whether characters will respawn automatically. The default value is true.
If this property is disabled (false), player characters will not spawn until the Player:LoadCharacter() function is called for each Player, including when players join the experience.
This can be useful in experiences where players have finite lives, such as competitive games in which players do not respawn until a game round ends.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 4
- 553 Change Default of CharacterAutoLoads from to
- 486 Change ThreadSafety of CharacterAutoLoads from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CharacterAutoLoads from to ReadOnly
- 55 Add CharacterAutoLoads
Chat
Parameters (1) | ||
---|---|---|
Returns (1) | ||
null |
This function makes the local player chat the given message. Since this item is protected, attempting to use it in a Script or LocalScript will cause an error.
Instead, when creating a custom chat system, or a system that needs access to the chat, you can use the Chat service's Chat:Chat() function instead.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
ClassicChat
Type | Default | |
---|---|---|
bool |
Indicates whether or not classic chat is enabled. This property is set by the Players:SetChatStyle() method using the ChatStyle enum.
When this chat mode is enabled, the game displays chats in a bubble above the sender's head.
There are two other chat modes, Players.BubbleChat and a chat mode where both classic and bubble chat are enabled.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of ClassicChat from to
- 486 Change ThreadSafety of ClassicChat from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ClassicChat from to ReadOnly
- 47 Add ClassicChat
CreateHumanoidModelFromDescription
Parameters (3) | Default | |
---|---|---|
description | HumanoidDescription | |
rigType | HumanoidRigType | |
assetTypeVerification | AssetTypeVerification | Default |
Returns (1) | ||
Model |
Returns a character Model equipped with everything specified in the passed in HumanoidDescription, and is R6 or R15 as specified by the rigType.
Thread safety | Unsafe |
---|
History 10
- 498 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default) to (description: HumanoidDescription, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 498 Change ReturnType of CreateHumanoidModelFromDescription from Instance to Model
- 462 Change ThreadSafety of CreateHumanoidModelFromDescription from to Unsafe
- 454 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType) to (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 452 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default) to (description: Instance, rigType: HumanoidRigType)
- 453 Change Parameters of CreateHumanoidModelFromDescription from (description: Instance, rigType: HumanoidRigType) to (description: Instance, rigType: HumanoidRigType, assetTypeVerification: AssetTypeVerification = Default)
- 443 Change Security of CreateHumanoidModelFromDescription from RobloxScriptSecurity to None
- 442 Change Security of CreateHumanoidModelFromDescription from None to RobloxScriptSecurity
- 443 Change Security of CreateHumanoidModelFromDescription from RobloxScriptSecurity to None
- 377 Add CreateHumanoidModelFromDescription
CreateHumanoidModelFromUserId
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Model |
Returns a character Model set-up with everything equipped to match the avatar of the user specified by the passed in userId. This includes whether that character is currently R6 or R15.
Thread safety | Unsafe |
---|
History 6
- 498 Change ReturnType of CreateHumanoidModelFromUserId from Instance to Model
- 462 Change ThreadSafety of CreateHumanoidModelFromUserId from to Unsafe
- 443 Change Security of CreateHumanoidModelFromUserId from RobloxScriptSecurity to None
- 442 Change Security of CreateHumanoidModelFromUserId from None to RobloxScriptSecurity
- 443 Change Security of CreateHumanoidModelFromUserId from RobloxScriptSecurity to None
- 377 Add CreateHumanoidModelFromUserId
CreateLocalPlayer
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Player |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 7
- 498 Change ReturnType of CreateLocalPlayer from Instance to Player
- 462 Change ThreadSafety of CreateLocalPlayer from to Unsafe
- 310 Change Security of CreateLocalPlayer from PluginSecurity to LocalUserSecurity
- 310 Change Parameters of CreateLocalPlayer from (userId: int, isTeleport: bool = false) to ()
- 215 Change Parameters of CreateLocalPlayer from (userId: int) to (userId: int, isTeleport: bool = false)
- 151 Change Security of CreateLocalPlayer from LocalUserSecurity to PluginSecurity
- 47 Add CreateLocalPlayer
FriendRequestEvent
Parameters (3) | |
---|---|
player | Player |
player | Player |
friendRequestEvent | FriendRequestEvent |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 483 Change Parameters of FriendRequestEvent from (player: Instance, player: Instance, friendRequestEvent: FriendRequestEvent) to (player: Player, player: Player, friendRequestEvent: FriendRequestEvent)
- 462 Change ThreadSafety of FriendRequestEvent from to Unsafe
- 71 Change Parameters of FriendRequestEvent from (player: Instance, player: Instance, FriendRequestEvent: FriendRequestEvent) to (player: Instance, player: Instance, friendRequestEvent: FriendRequestEvent)
- 47 Add FriendRequestEvent
GameAnnounce
Parameters (1) |
---|
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GameAnnounce from to Unsafe
- 47 Add GameAnnounce
GetBanHistoryAsync
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
BanHistoryPages |
Retrieves the ban and unban history of any user within the experience's universe. This method returns a BanHistoryPages instance that inherits from Pages. This method is enabled and disabled by the Players.BanningEnabled property, which you can toggle in Studio.
This function call will only succeed on production game servers and not on client devices or in Studio.
This API uses the User Restrictions Open Cloud API. You will be able to utilize these APIs to manage your bans in third party applications.
Thread safety | Unsafe |
---|
History 1
GetCharacterAppearanceAsync
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Model |
This function returns a Model containing the assets which the player is wearing, excluding gear.
If you prefer a Lua table of information about these assets instead of a model, use Players:GetCharacterAppearanceInfoAsync().
This method behaves similar to InsertService:LoadAsset(), and is like using LoadAsset on the asset information returned by Players:GetCharacterAppearanceInfoAsync() except faster.
Thread safety | Unsafe |
---|
History 5
- 498 Change ReturnType of GetCharacterAppearanceAsync from Instance to Model
- 481 Change Tags of GetCharacterAppearanceAsync from [Yields] to [Yields, Deprecated]
- 462 Change ThreadSafety of GetCharacterAppearanceAsync from to Unsafe
- 322 Change Parameters of GetCharacterAppearanceAsync from (userId: int) to (userId: int64)
- 212 Add GetCharacterAppearanceAsync
GetCharacterAppearanceInfoAsync
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Dictionary |
This function returns information about a player's avatar (ignoring gear) on the Roblox website in the form of a dictionary. It is not to be confused with GetCharacterAppearanceAsync, which actually loads the assets described by this method. You can use InsertService:LoadAsset() to load the assets that are used in the player's avatar. The structure of the returned dictionary is as follows:
Name | Type | Description |
---|---|---|
assets | table (see below) | Describes the equipped assets (hats, body parts, etc) |
bodyColors | table (see below) | Describes the BrickColor values for each limb |
bodyColor3s | table (see below) | Describes the Color3 instance for each limb which may not match perfectly with bodyColors |
defaultPantsApplied | bool | Describes whether default pants are applied |
defaultShirtApplied | bool | Describes whether default shirt is applied |
emotes | table (see below) | Describes the equipped emote animations |
playerAvatarType | string | Either "R15" or "R6" |
scales | table (see below) | Describes various body scaling factors |
Assets Sub-Table
The assets
table is an array of tables containing the following keys
that describe the assets currently equipped by the player:
Name | Type | Description |
---|---|---|
id | number | The asset ID of the equipped asset |
assetType | table | A table with name and id fields, each describing the kind of asset equipped ("Hat", "Face", etc.) |
name | string | The name of the equipped asset |
Scales Sub-Table
The scales
table has the following keys, each a number corresponding to
one Humanoid scaling property: bodyType
, head
, height
,
proportion
, depth
, width
.
Body Colors Sub-Table
The bodyColors
table has the following keys, each a number corresponding
to a BrickColor ID number which can be used with
BrickColor.new(id): leftArmColorId
, torsoColorId
,
rightArmColorId
, headColorId
, leftLegColorId
, rightLegColorId
.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetCharacterAppearanceInfoAsync from to Unsafe
- 322 Change Parameters of GetCharacterAppearanceInfoAsync from (userId: int) to (userId: int64)
- 306 Add GetCharacterAppearanceInfoAsync
GetFriendsAsync
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
FriendPages |
The GetFriends Players function returns a FriendPages object which contains information for all of the given user's friends. The items within the FriendPages object are tables with the following fields:
Name | Type | Description |
---|---|---|
Id | int64 | The friend's UserId |
Username | string | The friend's username |
DisplayName | string | The display name of the friend. |
See the code samples for an easy way to iterate over all a player's friends.
Thread safety | Unsafe |
---|
History 4
- 498 Change ReturnType of GetFriendsAsync from Instance to FriendPages
- 462 Change ThreadSafety of GetFriendsAsync from to Unsafe
- 323 Change Parameters of GetFriendsAsync from (userId: int) to (userId: int64)
- 204 Add GetFriendsAsync
GetHumanoidDescriptionFromOutfitId
Parameters (1) | ||
---|---|---|
outfitId | int64 | |
Returns (1) | ||
HumanoidDescription |
Returns the HumanoidDescription for a specified outfitId, which will be set with the parts/colors/Animations etc of the outfit. An outfit can be one created by a user, or it can be the outfit for a bundle created by Roblox.
Thread safety | Unsafe |
---|
History 3
- 498 Change ReturnType of GetHumanoidDescriptionFromOutfitId from Instance to HumanoidDescription
- 462 Change ThreadSafety of GetHumanoidDescriptionFromOutfitId from to Unsafe
- 369 Add GetHumanoidDescriptionFromOutfitId
GetHumanoidDescriptionFromUserId
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
HumanoidDescription |
Returns a HumanoidDescription which specifies everything equipped for the avatar of the user specified by the passed in userId. Also includes scales and body colors.
Thread safety | Unsafe |
---|
History 3
- 498 Change ReturnType of GetHumanoidDescriptionFromUserId from Instance to HumanoidDescription
- 462 Change ThreadSafety of GetHumanoidDescriptionFromUserId from to Unsafe
- 369 Add GetHumanoidDescriptionFromUserId
GetNameFromUserIdAsync
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
string |
The GetNameFromUserIdAsync Players function will send a query to the Roblox website asking what the username is of the account with the given UserId.
This method errors if no account exists with the given UserId. If you aren't certain such an account exists, it's recommended to wrap calls to this function with pcall(). In addition, you can manually cache results to make future calls with the same UserId fast. See the code samples to learn more.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetNameFromUserIdAsync from to Unsafe
- 323 Change Parameters of GetNameFromUserIdAsync from (userId: int) to (userId: int64)
- 202 Add GetNameFromUserIdAsync
GetPlayerByUserId
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Player |
This function searches each Player in Players for one
whose Player.UserId matches the given UserId. If such a player
does not exist, it simply returns nil
. It is equivalent to the following
function:
1 2 3 4 5 6 7 8 |
|
This method is useful in finding the purchaser of a developer product using MarketplaceService.ProcessReceipt, which provides a table that includes the purchaser's UserId and not a reference to the Player object itself. Most games will require a reference to the player in order to grant products.
Thread safety | Safe |
---|
History 5
- 567 Change ThreadSafety of GetPlayerByUserId from Unsafe to Safe
- 483 Change ReturnType of GetPlayerByUserId from Instance to Player
- 462 Change ThreadSafety of GetPlayerByUserId from to Unsafe
- 319 Change Parameters of GetPlayerByUserId from (userId: int) to (userId: int64)
- 202 Add GetPlayerByUserId
GetPlayerFromCharacter
Parameters (1) | ||
---|---|---|
character | Model | |
Returns (1) | ||
Player |
This function returns the Player associated with the given
Player.Character, or nil
if one cannot be found. It is
equivalent to the following function:
1 2 3 4 5 6 7 |
|
This method is often used when some event in player's character fires (such as their Humanoid dying). Such an event might not directly reference the Player object, but this method provides easy access. The inverse of this function can be described as getting the Character of a Player. To do this, simply access the Character property.
Thread safety | Unsafe |
---|
History 4
- 483 Change Parameters of GetPlayerFromCharacter from (character: Instance) to (character: Model)
- 483 Change ReturnType of GetPlayerFromCharacter from Instance to Player
- 462 Change ThreadSafety of GetPlayerFromCharacter from to Unsafe
- 47 Add GetPlayerFromCharacter
GetPlayers
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Instances |
This method returns a table of all presently connected Player
objects. It functions the same way Instance:GetChildren() would
except that it only returns Player objects found under
Players. When used with a for
loop, it is useful for iterating
over all players in a game.
1 2 3 4 5 |
|
Scripts that connect to Players.PlayerAdded are often trying to process every Player that connects to the game. This method is useful for iterating over already-connected players that wouldn't fire PlayerAdded. Using this method ensures that no player is missed!
1 2 3 4 5 6 7 8 9 10 |
|
Thread safety | Safe |
---|
History 4
- 648 Change ReturnType of GetPlayers from Objects to Instances
- 533 Change ThreadSafety of GetPlayers from Unsafe to Safe
- 462 Change ThreadSafety of GetPlayers from to Unsafe
- 47 Add GetPlayers
GetUserIdFromNameAsync
Parameters (1) | ||
---|---|---|
userName | string | |
Returns (1) | ||
int64 |
This function will send a query to the Roblox website asking what the Player.UserId is of the account with the given Player name.
This method errors if no account exists with the given username. If you aren't certain such an account exists, it's recommended to wrap calls to this function with pcall(). In addition, you can manually cache results to quickly make future calls with the same username. See the code samples to learn more.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetUserIdFromNameAsync from to Unsafe
- 323 Change ReturnType of GetUserIdFromNameAsync from int to int64
- 202 Add GetUserIdFromNameAsync
GetUserThumbnailAsync
Parameters (3) | ||
---|---|---|
userId | int64 | |
thumbnailType | ThumbnailType | |
thumbnailSize | ThumbnailSize | |
Returns (1) | ||
Tuple |
This function returns the content URL of an image of a player's avatar given their UserId, the desired image size as a ThumbnailSize enum, and the desired type as a ThumbnailType enum. It also returns a boolean describing if the image is ready to use.
Most often, this method is used with ImageLabel.Image or Decal.Texture to display user avatar pictures in an experience.
Thread safety | Unsafe |
---|
History 7
- 462 Change ThreadSafety of GetUserThumbnailAsync from to Unsafe
- 323 Change Parameters of GetUserThumbnailAsync from (userId: int, thumbnailType: ThumbnailType, thumbnailSize: ThumbnailSize) to (userId: int64, thumbnailType: ThumbnailType, thumbnailSize: ThumbnailSize)
- 287 Add GetUserThumbnailAsync
- 285 Remove GetUserThumbnailAsync
- 286 Add GetUserThumbnailAsync
- 285 Remove GetUserThumbnailAsync
- 286 Add GetUserThumbnailAsync
LocalPlayer
Type | Default | |
---|---|---|
Player |
This read-only property refers to the Player whose client is running the experience.
This property is only defined for LocalScripts and
ModuleScripts required by them, since they run on the
client. For the server, on which Script objects run their code,
this property is nil
.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 9
- 553 Change Default of LocalPlayer from to
- 486 Change ThreadSafety of LocalPlayer from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LocalPlayer from to ReadOnly
- 454 Change ValueType of LocalPlayer from Instance to Player
- 452 Change ValueType of LocalPlayer from Player to Instance
- 453 Change ValueType of LocalPlayer from Instance to Player
- 329 Change ValueType of LocalPlayer from Object to Instance
- 200 Change Tags of LocalPlayer from [Hidden, ReadOnly, NotReplicated] to [ReadOnly, NotReplicated]
- 47 Add LocalPlayer
MaxPlayers
Type | Default | |
---|---|---|
int |
This property determines the maximum number of players that can be in a server. This property can only be set through a specific place's settings on the Creator Dashboard or through Game Settings.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 7
- 553 Change Default of MaxPlayers from to
- 486 Change ThreadSafety of MaxPlayers from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MaxPlayers from to ReadOnly
- 209 Change WriteSecurity of MaxPlayers from RobloxSecurity to None
- 209 Change Tags of MaxPlayers from [NotReplicated] to [ReadOnly, NotReplicated]
- 209 Change ReadSecurity of MaxPlayers from RobloxSecurity to None
- 47 Add MaxPlayers
NumPlayers
Type | Default | |
---|---|---|
int |
This property indicates the number of people in the server at the current time. It is read only. Meaning it cannot be written to, only read.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 6
- 553 Change PreferredDescriptor of NumPlayers from to GetPlayers
- 553 Change Default of NumPlayers from to
- 486 Change ThreadSafety of NumPlayers from ReadOnly to ReadSafe
- 462 Change ThreadSafety of NumPlayers from to ReadOnly
- 292 Change Tags of NumPlayers from [ReadOnly, NotReplicated] to [ReadOnly, NotReplicated, Deprecated]
- 47 Add NumPlayers
PlayerAdded
Parameters (1) | |
---|---|
player | Player |
This event fires when a player enters the game. This is used to fire an event when a player joins a game, such as loading the player's saved GlobalDataStore data.
This can be used alongside the Players.PlayerRemoving event, which fires when a player is about to leave the game. For instance, if you would like print a message every time a new player joins or leaves the game:
1 2 3 4 5 6 7 8 9 |
|
If you want to track when a player's character is added or removed from the game, such as when a player respawns or dies, you can use the Player.CharacterAdded and Player.CharacterRemoving functions.
Note that this event does not work as expected in Play mode because
the player is created before scripts run that connect to
PlayerAdded. To handle this case, as well as
cases in which the script is added into the game after a player enters,
create an onPlayerAdded()
function that you can call to handle a
player's entrance.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of PlayerAdded from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerAdded from to Unsafe
- 47 Add PlayerAdded
PlayerChatted
Parameters (4) | |
---|---|
chatType | PlayerChatType |
player | Player |
targetPlayer | Player |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 498 Change Parameters of PlayerChatted from (chatType: PlayerChatType, player: Instance, message: string, targetPlayer: Instance) to (chatType: PlayerChatType, player: Player, message: string, targetPlayer: Player)
- 462 Change ThreadSafety of PlayerChatted from to Unsafe
- 83 Change Security of PlayerChatted from RobloxScriptSecurity to LocalUserSecurity
- 47 Add PlayerChatted
PlayerConnecting
Parameters (1) | |
---|---|
player | Player |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 498 Change Parameters of PlayerConnecting from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerConnecting from to Unsafe
- 272 Add PlayerConnecting
PlayerDisconnecting
Parameters (1) | |
---|---|
player | Player |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 498 Change Parameters of PlayerDisconnecting from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerDisconnecting from to Unsafe
- 272 Add PlayerDisconnecting
PlayerMembershipChanged
Parameters (1) | |
---|---|
player | Player |
This event fires when the game server recognizes that a player's membership has changed. Note, however, that the server will only attempt to check and update the membership after the Premium modal has been closed. Thus, to account for cases where the user purchases Premium outside of the game while playing, you must still prompt them to purchase Premium; this will then show a message telling them they're already upgraded and, once they close the modal, the game server will update their membership and trigger this event.
To learn more about and incorporating Premium into your experience and monetizing with the engagement-based payouts system, see Engagement-Based Payouts.
See also:
- MarketplaceService:PromptPremiumPurchase(), used to prompt a user to purchase Premium
- MarketplaceService.PromptPremiumPurchaseFinished, fires when the Premium purchase UI closes
Thread safety | Unsafe |
---|
History 3
- 498 Change Parameters of PlayerMembershipChanged from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerMembershipChanged from to Unsafe
- 416 Add PlayerMembershipChanged
PlayerRejoining
Parameters (1) | |
---|---|
player | Player |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 498 Change Parameters of PlayerRejoining from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerRejoining from to Unsafe
- 272 Add PlayerRejoining
PlayerRemoving
Parameters (1) | |
---|---|
player | Player |
The PlayerRemoving event fires right before a Player leaves the game. This event fires before ChildRemoved does on Players, and behaves somewhat similarly to Instance.DescendantRemoving. Since it fires before the actual removal of a Player, this event is useful for storing player data using a GlobalDataStore.
This can be used alongside the Player.PlayerAdded event, which fires when a player joins the game. For instance, to print a message every time a new player joins or leaves the game:
1 2 3 4 5 6 7 8 9 |
|
If you want to track when a player's character is added or removed from the game, such as when a player respawns or dies, you can use the Player.CharacterAdded and Player.CharacterRemoving functions.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of PlayerRemoving from (player: Instance) to (player: Player)
- 462 Change ThreadSafety of PlayerRemoving from to Unsafe
- 47 Add PlayerRemoving
PreferredPlayers
Type | Default | |
---|---|---|
int |
This property indicates the number of players to which Roblox's matchmaker will fill servers. This number will be less than the maximum number of players (Players.MaxPlayers) supported by the experience.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of PreferredPlayers from to
- 486 Change ThreadSafety of PreferredPlayers from ReadOnly to ReadSafe
- 462 Change ThreadSafety of PreferredPlayers from to ReadOnly
- 209 Add PreferredPlayers
ReportAbuse
Parameters (3) | ||
---|---|---|
player | Player | |
reason | string | |
optionalMessage | string | |
Returns (1) | ||
null |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 5
- 573 Change ReturnType of ReportAbuse from void to null
- 498 Change Parameters of ReportAbuse from (player: Instance, reason: string, optionalMessage: string) to (player: Player, reason: string, optionalMessage: string)
- 462 Change ThreadSafety of ReportAbuse from to Unsafe
- 83 Change Security of ReportAbuse from RobloxScriptSecurity to LocalUserSecurity
- 47 Add ReportAbuse
ReportAbuseV3
Parameters (2) | ||
---|---|---|
player | Player | |
jsonTags | string | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 573 Change ReturnType of ReportAbuseV3 from void to null
- 540 Add ReportAbuseV3
ReportChatAbuse
Parameters (3) | ||
---|---|---|
eligibleChatLines | Array | |
targetChatLines | Array | |
tags | Dictionary | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 643 Add ReportChatAbuse
ResetLocalPlayer
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 573 Change ReturnType of ResetLocalPlayer from void to null
- 565 Add ResetLocalPlayer
RespawnTime
Type | Default | |
---|---|---|
float |
This property controls the time, in seconds, it takes for a player to respawn when Players.CharacterAutoLoads is true. It defaults to 5.0 seconds.
This is useful when you want to change how long it takes to respawn based on the type of your experience but don't want to handle spawning players individually.
Although this property can be set from within a Script, you can more easily set it directly on the Players object in Studio's Explorer window.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of RespawnTime from to
- 486 Change ThreadSafety of RespawnTime from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RespawnTime from to ReadOnly
- 371 Add RespawnTime
SetChatStyle
Parameters (1) | Default | |
---|---|---|
style | ChatStyle | Classic |
Returns (1) | ||
null |
This function sets whether BubbleChat and ClassicChat are being used, and tells TeamChat and Chat what to do using the ChatStyle enum. Since this item is protected, attempting to use it in a Script or LocalScript will cause an error.
This function is used internally when the chat mode is set by the game.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 573 Change ReturnType of SetChatStyle from void to null
- 462 Change ThreadSafety of SetChatStyle from to Unsafe
- 151 Change Security of SetChatStyle from LocalUserSecurity to PluginSecurity
- 47 Add SetChatStyle
SetLocalPlayerInfo
Parameters (5) | ||
---|---|---|
userId | int64 | |
userName | string | |
displayName | string | |
membershipType | MembershipType | |
isUnder13 | bool | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 573 Change ReturnType of SetLocalPlayerInfo from void to null
- 462 Change ThreadSafety of SetLocalPlayerInfo from to Unsafe
- 427 Change Parameters of SetLocalPlayerInfo from (userId: int64, userName: string, membershipType: MembershipType, isUnder13: bool) to (userId: int64, userName: string, displayName: string, membershipType: MembershipType, isUnder13: bool)
- 374 Add SetLocalPlayerInfo
TeamChat
Parameters (1) | ||
---|---|---|
Returns (1) | ||
null |
This function makes the Players.LocalPlayer chat the given message, which will only be viewable by users on the same team. Since this item is protected, attempting to use it in a Script or LocalScript will cause an error.
This function is used internally when the Players.LocalPlayer sends a message to their team.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
UnbanAsync
Parameters (1) | ||
---|---|---|
config | Dictionary | |
Returns (1) | ||
null |
Unbans players banned from Players:BanAsync() or the User Restrictions Open Cloud API. This method is enabled and disabled by the Players.BanningEnabled property, which you can toggle in Studio.
Like Players:BanAsync(), this method takes in a config
dictionary that will let you bulk unban users. This configures the users
that are unbanned and the scope from which they are unbanned from.
Unbans will only take effect on bans with the same ApplyToUniverse
scope. For example, an unban with ApplyToUniverse
set to true
will not
invalidate a previous ban with ApplyToUniverse
set to false
. In other
words, a universe level unban will not invalidate a place level ban. The
opposite also holds true.
This method invokes a HTTP call to backend services, which are throttled
and may fail. If you are calling this API with multiple UserIds, this
method will attempt to make this HTTP call for each UserId. It will then
aggregate any error messages and join them as a comma separated list. For
example, if this method is invoked for five UserIds
: {1, 2, 3, 4, 5}
and requests for users 2 and 4 fail then the following error message
appears:
HTTP failure for UserId 2: Timedout, HTTP 504 (Service unavailable) failure for UserId 4: Service exception.
The message will always include failure for UserId {}
if it is an HTTP
error. It is undefined behavior if you pass in both valid and invalid
UserIds, i.e. a UserId
that is not a positive number, as some network
requests may succeed before all input is validated.
Because of the risks associated with banning users, this method may only be called on the backend game server. Client side calls will result in an error. You may test this API in Studio, Team Create, and Team Test, but the bans will not apply to production. This function call will only attempt ban requests on production game servers and not in Studio testing. However, all input validation steps will still work in Studio.
This API uses the User Restrictions Open Cloud API. You will be able to utilize these APIs to manage your bans in third party applications.
Thread safety | Unsafe |
---|
History 1
- 622 Add UnbanAsync
UseStrafingAnimations
Type | Default | |
---|---|---|
bool |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 2
- 578 Change Tags of UseStrafingAnimations from [NotReplicated, NotScriptable] to [NotScriptable]
- 553 Add UseStrafingAnimations
UserSubscriptionStatusChanged
Parameters (2) | |
---|---|
user | Player |
subscriptionId | string |
This event fires when the game server recognizes that the user's status for a certain subscription has changed. Note that the server only attempts to check and update the status after the Subscription Purchase modal has been closed. To account for cases in which the user purchases the subscription outside of the game while playing, you must still prompt them to purchase the subscription; the prompt shows a message telling the user they're already subscribed, and after they close the modal, the game server updates their subscription status and triggers this event.
Note that only server scripts receive this event.
Thread safety | Unsafe |
---|
History 2
- 594 Change Security of UserSubscriptionStatusChanged from RobloxScriptSecurity to None
- 590 Add UserSubscriptionStatusChanged
WhisperChat
Parameters (2) | ||
---|---|---|
player | Instance | |
Returns (1) | ||
null |
Security | LocalUserSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 573 Change ReturnType of WhisperChat from void to null
- 462 Change ThreadSafety of WhisperChat from to Unsafe
- 83 Change Security of WhisperChat from RobloxScriptSecurity to LocalUserSecurity
- 47 Add WhisperChat
getPlayers
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Instances |
Thread safety | Unsafe |
---|
History 4
- 648 Change ReturnType of getPlayers from Objects to Instances
- 553 Change PreferredDescriptor of getPlayers from to GetPlayers
- 462 Change ThreadSafety of getPlayers from to Unsafe
- 49 Add getPlayers
playerFromCharacter
Parameters (1) | ||
---|---|---|
character | Model | |
Returns (1) | ||
Player |
Thread safety | Unsafe |
---|
History 6
- 553 Change PreferredDescriptor of playerFromCharacter from to GetPlayerFromCharacter
- 483 Change Parameters of playerFromCharacter from (character: Instance) to (character: Model)
- 483 Change ReturnType of playerFromCharacter from Instance to Player
- 462 Change ThreadSafety of playerFromCharacter from to Unsafe
- 49 Change Tags of playerFromCharacter from [] to [Deprecated]
- 47 Add playerFromCharacter
players
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Instances |
This function was once used to return a list of players in a game, but has since been deprecated in favor of Players:GetPlayers()
Thread safety | Unsafe |
---|
Removed members 19
AddLeaderboardKey
Parameters (1) | ||
---|---|---|
key | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 4
- 258 Remove AddLeaderboardKey
- 257 Add AddLeaderboardKey
- 258 Remove AddLeaderboardKey
- 47 Add AddLeaderboardKey
BlockUser
Parameters (2) | ||
---|---|---|
blockerUserId | int | |
blockeeUserId | int | |
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|
GetPlayerByID
Parameters (1) | ||
---|---|---|
userID | int | |
Returns (1) | ||
Instance |
Security | LocalUserSecurity |
---|
History 3
- 310 Remove GetPlayerByID
- 210 Change Tags of GetPlayerByID from [] to [Deprecated]
- 47 Add GetPlayerByID
GetPlayerById
Parameters (1) | ||
---|---|---|
userId | int | |
Returns (1) | ||
Instance |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove GetPlayerById
- 210 Add GetPlayerById
GetUseCoreScriptHealthBar
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|
History 2
PlayerAddedEarly
Parameters (1) | |
---|---|
player | Instance |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove PlayerAddedEarly
- 47 Add PlayerAddedEarly
PlayerRemovingLate
Parameters (1) | |
---|---|
player | Instance |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove PlayerRemovingLate
- 47 Add PlayerRemovingLate
SetAbuseReportUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | RobloxSecurity |
---|
History 2
- 310 Remove SetAbuseReportUrl
- 47 Add SetAbuseReportUrl
SetBuildToolsUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | RobloxSecurity |
---|
History 2
- 51 Remove SetBuildToolsUrl
- 47 Add SetBuildToolsUrl
SetBuildUserPermissionsUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | RobloxSecurity |
---|
History 2
SetChatFilterUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | RobloxSecurity |
---|
History 2
- 310 Remove SetChatFilterUrl
- 47 Add SetChatFilterUrl
SetLoadDataUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove SetLoadDataUrl
- 47 Add SetLoadDataUrl
SetSaveDataUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove SetSaveDataUrl
- 47 Add SetSaveDataUrl
SetSaveLeaderboardDataUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 4
SetSysStatsUrl
Parameters (1) | ||
---|---|---|
url | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove SetSysStatsUrl
- 47 Add SetSysStatsUrl
SetSysStatsUrlId
Parameters (1) | ||
---|---|---|
urlId | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 310 Remove SetSysStatsUrlId
- 47 Add SetSysStatsUrlId
UnblockUser
Parameters (2) | ||
---|---|---|
exblockerUserId | int | |
exblockeeUserId | int | |
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|
History 2
- 284 Remove UnblockUser
- 181 Add UnblockUser
getPlayerFromCharacter
Parameters (1) | ||
---|---|---|
character | Instance | |
Returns (1) | ||
Instance |
Thread safety | Unsafe |
---|
History 3
- 480 Remove getPlayerFromCharacter
- 462 Change ThreadSafety of getPlayerFromCharacter from to Unsafe
- 49 Add getPlayerFromCharacter