Skip to content
Roblox API Reference

Players

A service that contains presently connected Player objects.
  • Not creatable
  • Service
Memory category
Instances
Own members
70
Inherited members
75
Subclasses
0
Siblings
608

Properties39

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byPlayers16

Property categoryBehavior

  • Players.BanningEnabled: boolean
    Enables or disables the three Players methods (BanAsync(), UnbanAsync(), and GetBanHistoryAsync()) that constitute the ban API. This property cannot be set through developer-facing Luau and must be set in Studio through the Players properties window.
    • Not scriptable
    • Read capabilities: Players
  • Players.CharacterAutoLoads: boolean
    Indicates whether characters will respawn automatically.
    • Not replicated
    • Read capabilities: Players
  • Players.UseStrafingAnimations: boolean
    Determines whether R15 character models play directional strafing and backpedaling animations instead of always turning to face their direction of movement.
    • Not scriptable
    • Read capabilities: Players

Property categoryData

  • Players.BubbleChat: boolean
    Indicates whether or not bubble chat is enabled. It is set with the Players:SetChatStyle() method.
    • Read only
    • Read capabilities: Chat + Players
    • Write capabilities: Chat
  • Players.ClassicChat: boolean
    Indicates whether or not classic chat is enabled; set by the Players:SetChatStyle() method.
    • Read only
    • Read capabilities: Chat + Players
    • Write capabilities: Chat
  • Players.LocalPlayer: Player
    The Player that the LocalScript is running for.
    • Read only
    • Read capabilities: Players
  • Players.MaxPlayers: number
    The maximum number of players that can be in a server.
    • Read only
    • Read capabilities: Players
  • Players.MaxPlayersInternal: number
    • Hidden
    • Local user security
    • Read capabilities: Players
  • Players.PreferredPlayers: number
    The preferred number of players for a server.
    • Read only
    • Read capabilities: Players
  • Players.PreferredPlayersInternal: number
    • Hidden
    • Local user security
    • Read capabilities: Players
  • Players.RespawnTime: number
    Controls the amount of time taken for a players character to respawn.
    • Read capabilities: Players
  • Players.ServerGitHash: string
    • Hidden
    • Not scriptable
    • Roblox engine security
    • Read capabilities: Players
  • Players.ServerLogPrefix: string
    • Hidden
    • Not scriptable
    • Roblox engine security
    • Read capabilities: Players
  • Players.NumPlayers: number
    Deprecated: This item is deprecated. Instead, of using this item, you should count the number of players returned by Players:GetPlayers().
    Returns the number of people in the server at the current time.
    • Deprecated
    • Read only
    • Read capabilities: Players

    Use GetPlayers instead.

  • Players.localPlayer: Player
    Deprecated: This property is a deprecated variant of Players.LocalPlayer which should be used instead.
    • Deprecated
    • Hidden
    • Read only
    • Read capabilities: Players

    Use LocalPlayer instead.

  • Players.numPlayers: number
    Deprecated: This property is a deprecated variant of Players.NumPlayers which has also been deprecated. Neither property should be used in new work. Instead, you should count the number of players returned by Players:GetPlayers().
    Returns the number of people in the server at the current time.
    • Deprecated
    • Hidden
    • Read only
    • Read capabilities: Players

    Use NumPlayers instead.

Methods78

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byPlayers36
  • Players:BanAsync(config: { [string]: any })
    Bans users from your experience, with options to specify duration, reason, whether the ban applies to the entire universe or just the current place, and more. This method is enabled and disabled by the Players.BanningEnabled property, which you can toggle in Studio.
    • Yields
    • Capabilities: Consequences + Players
    Parameters
    ParameterDescription
    config: { [string]: any }
    • UserIds (required; array) — Array of UserIds of players to be banned. Max size is 50.
    • ApplyToUniverse (optional; boolean) — Whether ban propagates to all places within the experience universe. Default is true.
    • Duration (required; integer) — Duration of the ban, in seconds. Permanent bans should have a value of -1. 0 and all other negative values are invalid.
    • DisplayReason (required; string) — The message that will be displayed to users when they attempt to and fail to join an experience. Maximum string length is 400.
    • PrivateReason (required; string) — Internal messaging that will be returned when querying the user's ban history. Maximum string length is 1000.
    • ExcludeAltAccounts (optional; boolean) — When true, Roblox does not attempt to ban alternate accounts. Default is false.
    • ApplyDeviceBlock (optional; boolean) — When true, Roblox will block banned users' devices from rejoining the experience for 24 hours after the ban is applied. Default is false. The block can be overridden by unbanning a user via a call to Players:UnbanAsync(). Note that unbanning a user through any other method will not lift the device block.
  • Players:Chat(message: string)
    Makes the local player chat the given message.
    • Plugin security
    • Capabilities: Players
    Parameters
    ParameterDescription
    message: string
    The message chatted.
  • Players:CreateHumanoidModelFromDescriptionAsync(description: HumanoidDescription,rigType: Enum.HumanoidRigType,assetTypeVerification: Enum.AssetTypeVerification? = Enum.AssetTypeVerification.Default,): Model
    Returns a character Model equipped with everything specified in the passed in HumanoidDescription. If UseAvatarSettings is set to true, Avatar Settings in the experience will be applied to the returned model.
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    description: HumanoidDescription
    Specifies the appearance of the returned character.
    rigType: Enum.HumanoidRigType
    Specifies whether the returned character will be R6 or R15.
    assetTypeVerification: Enum.AssetTypeVerification? = Enum.AssetTypeVerification.Default
    The asset type verification mode.
    Returns
    TypeDescription
    Model
    A Humanoid character Model.
  • Players:CreateHumanoidModelFromUserIdAsync(userId: User): Model
    Returns a character Model set-up with everything equipped to match the avatar of the user specified by the passed in userId.
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The userId for a Roblox user. (The UserId is the number in the profile of the user e.g www.roblox.com/users/1/profile).
    Returns
    TypeDescription
    Model
    A Humanoid character Model.
  • Players:CreateLocalPlayer(): Player
    • Local user security
    • Capabilities: Players
    Returns
    Type
    Player
  • Players:CreateThumbnailPlayer(): Player
    • Roblox script security
    • Capabilities: Players
    Returns
    Type
    Player
  • Players:GetBanHistoryAsync(userId: User): BanHistoryPages
    Retrieves the ban and unban history of any user within the experience's universe. This method is enabled and disabled by the Players.BanningEnabled property, which you can toggle in Studio.
    • Yields
    • Capabilities: Consequences + Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the player whose ban history to retrieve.
    Returns
    TypeDescription
    BanHistoryPages
    See BanHistoryPages for return reference.
  • Players:GetCharacterAppearanceInfoAsync(userId: User): { [string]: any }
    Returns information about the character appearance of a given user.
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The *userId of the specified player.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary containing information about the character appearance of a given user.
  • Players:GetFriendsAsync(userId: User): FriendPages
    Returns a FriendPages object which contains information for all of the given player's friends.
    • Yields
    • Capabilities: Players + Social
    Parameters
    ParameterDescription
    userId: User
    The user ID of the player being specified.
    Returns
    TypeDescription
    FriendPages
    A FriendPages object containing information for all of the given user's friends.
  • Players:GetHumanoidDescriptionFromOutfitIdAsync(outfitId: number): HumanoidDescription
    Returns the HumanoidDescription for a specified outfit, which will be set with the parts/colors/Animations etc of the outfit.
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    outfitId: number
    The ID of the outfit for which the HumanoidDescription is sought.
    Returns
    TypeDescription
    HumanoidDescription
    HumanoidDescription initialized with the specification for the passed in outfitId.
  • Players:GetHumanoidDescriptionFromUserIdAsync(userId: User): HumanoidDescription
    Returns a HumanoidDescription which specifies everything equipped for the avatar of the user specified by the passed in userId.
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    userId: User
    The userId for a Roblox user. (The UserId is the number in the profile of the user e.g www.roblox.com/users/1/profile).
    Returns
    TypeDescription
    HumanoidDescription
    HumanoidDescription initialized with the passed in user's avatar specification.
  • Players:GetNameFromUserIdAsync(userId: User): string
    Sends a query to the Roblox website for the username of an account with a given UserId.
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the player being specified.
    Returns
    TypeDescription
    string
    The name of a user with the specified Player.UserId.
  • Players:GetPlayerByUserId(userId: User): Player
    Returns the Player with the given UserId if they are in-experience.
    • Thread safe
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the player being specified.
    Returns
    TypeDescription
    Player
    The Player with the given Player.UserId, or nil if no connected player has that UserId.
  • Players:GetPlayerFromCharacter(character: Model): Player
    Returns the Player whose Player.Character matches the given instance, or nil if one cannot be found.
    • Capabilities: Players
    • Simulation access
    Parameters
    ParameterDescription
    character: Model
    A character instance that you want to get the player from.
    Returns
    TypeDescription
    Player
    The Player whose Player.Character matches the given model, or nil if one cannot be found.
  • Players:GetPlayers(): { Instance }
    Returns a table of all presently connected Player objects.
    • Thread safe
    • Capabilities: Players
    Returns
    TypeDescription
    { Instance }
    A table containing all the players in the server.
  • Players:GetProfileConfigurationFromUserIdAsync(userId: User): { [string]: any }
    Returns the profile configuration of a user as a dictionary.
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the user whose profile configuration to retrieve.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary containing the user's profile configuration, such as the background asset ID.
  • Players:GetUserIdFromNameAsync(userName: string): number
    Sends a query to the Roblox website for the userId of an account with a given username.
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userName: string
    The username of the player being specified.
    Returns
    TypeDescription
    number
    The Player.UserId of a user whose name is specified.
  • Players:GetUserThumbnailAsync(userId: User,thumbnailType: Enum.ThumbnailType,thumbnailSize: Enum.ThumbnailSize,): ...any
    Returns the content URL of a player thumbnail given the size and type, as well as a boolean describing if the image is ready to use.
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the player being specified.
    thumbnailType: Enum.ThumbnailType
    A ThumbnailType describing the type of thumbnail.
    thumbnailSize: Enum.ThumbnailSize
    A ThumbnailSize specifying the size of the thumbnail.
    Returns
    TypeDescription
    ...any
    A tuple containing the content URL of a user thumbnail based on the specified parameters, and a bool describing if the image is ready to be used or not.
  • Players:ReportAbuse(player: Player, reason: string, optionalMessage: string)
    • Local user security
    • Capabilities: Players
    Parameters
    Parameter
    player: Player
    reason: string
    optionalMessage: string
  • Players:ReportAbuseV3(player: Player, jsonTags: string)
    • Roblox script security
    • Capabilities: Players
    Parameters
    Parameter
    player: Player
    jsonTags: string
  • Players:ReportAvatarAbuse(targetUserId: number, tags: { [string]: any })
    • Roblox script security
    • Capabilities: Players
    Parameters
    Parameter
    targetUserId: number
    tags: { [string]: any }
  • Players:ReportChatAbuse(eligibleChatLines: { any },targetChatLines: { any },tags: { [string]: any },)
    • Roblox script security
    • Capabilities: Players
    Parameters
    Parameter
    eligibleChatLines: { any }
    targetChatLines: { any }
    tags: { [string]: any }
  • Players:ResetLocalPlayer()
    • Local user security
    • Capabilities: Players
  • Players:SetChatStyle(style: Enum.ChatStyle? = Enum.ChatStyle.Classic)
    Sets whether BubbleChat and ClassicChat are being used, and tells TeamChat and Chat what to do.
    • Plugin security
    • Capabilities: Players
    Parameters
    ParameterDescription
    style: Enum.ChatStyle? = Enum.ChatStyle.Classic
    The specified chat style being set.
  • Players:SetLocalPlayerInfo(userId: number,userName: string,displayName: string,membershipType: Enum.MembershipType,isUnder13: boolean,hasRobloxSubscription: boolean? = false,ageCheckedStatus: Enum.AgeCheckStatus? = Enum.AgeCheckStatus.Unchecked,)
    • Roblox script security
    • Capabilities: Players
    Parameters
    Parameter
    userId: number
    userName: string
    displayName: string
    membershipType: Enum.MembershipType
    isUnder13: boolean
    hasRobloxSubscription: boolean? = false
    ageCheckedStatus: Enum.AgeCheckStatus? = Enum.AgeCheckStatus.Unchecked
  • Players:TeamChat(message: string)
    Makes the local player chat the given message, which will only be viewable by users on the same team.
    • Plugin security
    • Capabilities: Players
    Parameters
    ParameterDescription
    message: string
    The message being chatted.
  • Players:UnbanAsync(config: { [string]: any })
    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.
    • Yields
    • Capabilities: Consequences + Players
    Parameters
    ParameterDescription
    config: { [string]: any }
    Name Type Description UserIds array UserIDs to be force allowed into the experience(s).

    Max size is 50. ApplyToUniverse boolean Propagates the unban to all places within this universe.
  • Players:WhisperChat(message: string, player: Instance)
    • Local user security
    • Capabilities: Players
    Parameters
    Parameter
    message: string
    player: Instance
  • Players:CreateHumanoidModelFromDescription(description: HumanoidDescription,rigType: Enum.HumanoidRigType,assetTypeVerification: Enum.AssetTypeVerification? = Enum.AssetTypeVerification.Default,): Model
    Deprecated: This method has been superseded by CreateHumanoidModelFromDescriptionAsync().
    Returns a character Model equipped with everything specified in the passed in HumanoidDescription.
    • Deprecated
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    description: HumanoidDescription
    Specifies the appearance of the returned character.
    rigType: Enum.HumanoidRigType
    Specifies whether the returned character will be R6 or R15.
    assetTypeVerification: Enum.AssetTypeVerification? = Enum.AssetTypeVerification.Default
    The asset type verification mode.
    Returns
    TypeDescription
    Model
    A Humanoid character Model.

    Use CreateHumanoidModelFromDescriptionAsync instead.

  • Players:CreateHumanoidModelFromUserId(userId: User): Model
    Deprecated: This method has been superseded by CreateHumanoidModelFromUserIdAsync().
    Returns a character Model set-up with everything equipped to match the avatar of the user specified by the passed in userId.
    • Deprecated
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The userId for a Roblox user. (The UserId is the number in the profile of the user e.g www.roblox.com/users/1/profile).
    Returns
    TypeDescription
    Model
    A Humanoid character Model.

    Use CreateHumanoidModelFromUserIdAsync instead.

  • Players:GetCharacterAppearanceAsync(userId: User): Model
    Deprecated: This method is deprecated. Do not use it for new work.
    Returns a Model containing the assets which the player is wearing, excluding gear.
    • Deprecated
    • Yields
    • Capabilities: Players
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the specified player.
    Returns
    TypeDescription
    Model
    A Model containing the assets the player is wearing, excluding gear.
  • Players:GetHumanoidDescriptionFromOutfitId(outfitId: number): HumanoidDescription
    Deprecated: This method has been superseded by GetHumanoidDescriptionFromOutfitIdAsync().
    Returns the HumanoidDescription for a specified outfit, which will be set with the parts/colors/Animations etc of the outfit.
    • Deprecated
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    outfitId: number
    The ID of the outfit for which the HumanoidDescription is sought.
    Returns
    TypeDescription
    HumanoidDescription
    HumanoidDescription initialized with the specification for the passed in outfitId.

    Use GetHumanoidDescriptionFromOutfitIdAsync instead.

  • Players:GetHumanoidDescriptionFromUserId(userId: User): HumanoidDescription
    Deprecated: This method has been superseded by GetHumanoidDescriptionFromUserIdAsync().
    Returns a HumanoidDescription which specifies everything equipped for the avatar of the user specified by the passed in userId.
    • Deprecated
    • Yields
    • Capabilities: AvatarAppearance + Players
    Parameters
    ParameterDescription
    userId: User
    The userId for a Roblox user. (The UserId is the number in the profile of the user e.g www.roblox.com/users/1/profile).
    Returns
    TypeDescription
    HumanoidDescription
    HumanoidDescription initialized with the passed in user's avatar specification.

    Use GetHumanoidDescriptionFromUserIdAsync instead.

  • Players:getPlayers(): { Instance }
    Deprecated: This function is a deprecated variant of Players:GetPlayers() which should be used instead.
    • Deprecated
    • Capabilities: Players
    Returns
    Type
    { Instance }

    Use GetPlayers instead.

  • Players:playerFromCharacter(character: Model): Player
    Deprecated: This function is a deprecated variant of Players:GetPlayerFromCharacter() which should be used in new work.
    • Deprecated
    • Capabilities: Players
    Parameters
    Parameter
    character: Model
    Returns
    Type
    Player

    Use GetPlayerFromCharacter instead.

  • Players:players(): { Instance }
    Deprecated: This item has been superseded by Players:GetPlayers() which should be used in all new work.
    Returns a list of players in an experience.
    • Deprecated
    • Capabilities: Players
    Returns
    Type
    { Instance }

    Use GetPlayers instead.

Events28

Inherited fromObject1
Inherited fromInstance9
Defined byPlayers18