Skip to content
Roblox API Reference

BadgeService

Provides information on badges and awards them.
  • Not creatable
  • Service
Memory category
Instances
Own members
11
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods51

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 byBadgeService9
  • BadgeService:AwardBadgeAsync(userId: User, badgeId: number): boolean
    Award a badge to a player given the ID of each.
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the user the badge is to be awarded to.
    badgeId: number
    The ID of the badge to be awarded.
    Returns
    TypeDescription
    boolean
    Boolean of true if the badge was awarded successfully.
  • BadgeService:CheckUserBadgesAsync(userId: User, badgeIds: { any }): { any }
    Checks a list of badge IDs against a UserId and returns a list of badge IDs that the player owns.
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The UserId of the player to check for ownership of the specified badges.
    badgeIds: { any }
    The list of IDs of the badges to check ownership of. Maximum length of 10.
    Returns
    TypeDescription
    { any }
    The list of badge IDs the given user owns out of the provided badge IDs. Empty if none of the provided badges are owned by the given user. Not guaranteed to be in the same order as the input list. Some badge IDs may be omitted if the user with the target userId has not recently been in the server and the badge IDs are not associated with the requesting experience.
  • BadgeService:GetBadgeInfoAsync(badgeId: number): { [string]: any }
    Fetch information about a badge given its ID.
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    badgeId: number
    The badge ID of the badge whose information should be fetched.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary of information about the specified badge.
  • BadgeService:GetUserBadgesAsync(userId: User, badgeIds: { any }): { any }
    Checks a list of badge IDs against a User and returns, for each badge the player owns, its ID and the date it was awarded.
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The User of the player to check for ownership of the specified badges.
    badgeIds: { any }
    The list of IDs of the badges to check ownership of. Maximum length of 100.
    Returns
    TypeDescription
    { any }
    A list of dictionaries, one for each badge the given user owns out of the provided badge IDs. Each dictionary contains a BadgeId and an AwardedDate. Empty if none of the provided badges are owned by the given user. Not guaranteed to be in the same order as the input list. Some badge IDs may be omitted if the user with the target User has not recently been in the server and the badge IDs are not associated with the requesting experience.
  • BadgeService:UserHasBadgeAsync(userId: User, badgeId: number): boolean
    Checks whether a player has the badge given the Player.UserId and the badge ID.
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the player to check for ownership of the specified badge.
    badgeId: number
    The badge ID of the badge whose ownership will be checked.
    Returns
    TypeDescription
    boolean
    Indicates if the specified user has the specified badge.
  • BadgeService:AwardBadge(userId: User, badgeId: number): boolean
    Deprecated: Use AwardBadgeAsync() instead.
    Award a badge to a player given the ID of each.
    • Deprecated
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The Player.UserId of the user the badge is to be awarded to.
    badgeId: number
    The ID of the badge to be awarded.
    Returns
    TypeDescription
    boolean
    Boolean of true if the badge was awarded successfully.

    Use AwardBadgeAsync instead.

  • BadgeService:IsDisabled(badgeId: number): boolean
    Deprecated: This function is deprecated. Do not use it for new work. Instead, it can be checked by calling BadgeService:GetBadgeInfoAsync() and checking the IsEnabled field.
    Returns whether a given badge is disabled.
    • Deprecated
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    badgeId: number
    The ID of the badge.
    Returns
    TypeDescription
    boolean
    True if the specified badge is not available to be awarded.
  • BadgeService:IsLegal(badgeId: number): boolean
    Deprecated: This function is deprecated and will always return true. Do not use it for new work.
    Determines if a given badge is associated with the current game.
    • Deprecated
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    badgeId: number
    The badge ID of the badge.
    Returns
    TypeDescription
    boolean
    True if the badge is associated with the current game.
  • BadgeService:UserHasBadge(userId: User, badgeId: number): boolean
    Deprecated: This method has been superseded by BadgeService:UserHasBadgeAsync() which should be used for new work instead.
    Checks whether a user has the badge given the Player.UserId and the badge ID.
    • Deprecated
    • Yields
    • Capabilities: AssetManagement
    Parameters
    ParameterDescription
    userId: User
    The user ID of the user.
    badgeId: number
    The badge ID of the badge.
    Returns
    TypeDescription
    boolean
    True if the user has the badge.

Events12

Inherited fromObject1
Inherited fromInstance9
Defined byBadgeService2