Skip to content

BadgeService

Supported Class Services NotCreatable Service

Provides information on badges and awards them.

12 Nova members · 5 modern Roblox members not implemented yet

Description

BadgeService provides information and functionality related to badges. Badges are used across the platform to recognize a player's achievements and activity. Upon awarding a badge to a player, it is added to their inventory and displayed on their profile page.

Inheritance

Object → Instance → BadgeService

Nova inheritance: Instance → BadgeService

Methods

AwardBadge Supported Function Deprecated Award a badge to a player given the ID of each.
BadgeService:AwardBadge(int userId, int badgeId): bool

Award a badge to a player given the ID of each.

Roblox reference signature
BadgeService:AwardBadge(userId: User, badgeId: int64): bool

Roblox documentation

IsDisabled Supported Function Deprecated Returns whether a given badge is disabled.
BadgeService:IsDisabled(int badgeId): bool

Returns whether a given badge is disabled.

This function returns whether the badge with the given ID is marked disabled on the Roblox website. A badge can be disabled by its owner on its page on the Roblox website, in the settings sub-menu. When a badge is disabled, this function returns true and the badge can no longer be awarded. A badge may be quickly re-enabled through the same menu.

In Studio, a badge can only be tested if it is disabled. Calling this function with an enabled badge in Studio will return true and produce a warning "Sorry, badges can only be tested if they are disabled on Roblox game servers".

Note that even if a badge is enabled it may not necessarily be awardable (for example if it isn't associated with the current game).

Badges that are associated with special events are a common reason for a badge to be disabled. Often, it is easier to simply disable a badge instead of hard-coding a time check for when some event ends.

Roblox reference signature
BadgeService:IsDisabled(badgeId: int64): bool

Roblox documentation

IsLegal Supported Function Deprecated Determines if a given badge is associated with the current game.
BadgeService:IsLegal(int badgeId): bool

This function determines if a given badge is associated with the current game. It returns true if the badge is associated with the current game.

Badges can only be awarded from a place that is part of the game associated with the badge. This means, for example, a developer cannot award a badge associated with another developer's game.

Even if this returns true, a badge may still not be award-able. For example, it may be disabled.

Roblox reference signature
BadgeService:IsLegal(badgeId: int64): bool

Roblox documentation

SetAwardBadgeUrl Supported Function
BadgeService:SetAwardBadgeUrl(string url)

No description available.

Security: LocalUserSecurity

Roblox documentation

SetHasBadgeCooldown Supported Function
BadgeService:SetHasBadgeCooldown(int seconds)

No description available.

Security: LocalUserSecurity

Roblox documentation

SetHasBadgeUrl Supported Function
BadgeService:SetHasBadgeUrl(string url)

No description available.

Security: LocalUserSecurity

Roblox documentation

SetIsBadgeDisabledUrl Supported Function
BadgeService:SetIsBadgeDisabledUrl(string url)

No description available.

Security: LocalUserSecurity

Roblox documentation

SetIsBadgeLegalUrl Supported Function
BadgeService:SetIsBadgeLegalUrl(string url)

No description available.

Security: LocalUserSecurity

Roblox documentation

SetPlaceId Supported Function
BadgeService:SetPlaceId(int placeId)

No description available.

Security: LocalUserSecurity

Roblox documentation

UserHasBadge Supported Function Deprecated Checks whether a user has the badge given the Player.UserId and the badge ID.
BadgeService:UserHasBadge(int userId, int badgeId): bool

Checks whether a user has the badge given the Player.UserId and the badge ID.

Checks and returns whether a Player owns a badge given their UserId and the badge ID. You can call the function from a server script or a ModuleScript eventually required by one. When calling the method from a client script (a LocalScript or a Script with RunContext of RunContext.Client), it only works for the local user whose client is running the script.

When called from a server script, any UserId can be used. If the user with the target user ID has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked. If the requested badge ID is not associated with the requesting experience and the target user has not recently been in the server, the method behaves as if the badge is not owned.

For users that have recently been in the server, any badge for any experience can be queried, no matter who created the badge or which experience it is used for.

Roblox reference signature
BadgeService:UserHasBadge(userId: User, badgeId: int64): bool

Roblox documentation

UserHasBadgeAsync Supported Function Checks whether a player has the badge given the Player.UserId and the badge ID.
BadgeService:UserHasBadgeAsync(int userId, int badgeId): bool

Checks whether a player has the badge given the Player.UserId and the badge ID.

Checks and returns whether a Player owns a badge given their UserId and the badge ID. You can call this method from a server script or a ModuleScript eventually required by one. When calling this method from a client script (a LocalScript or a Script with RunContext of RunContext.Client), it only works for the local user whose client is running the script.

When called from a server script, any UserId can be used. If the user with the target user ID has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked. If the requested badge ID is not associated with the requesting experience and the target user has not recently been in the server, the method behaves as if the badge is not owned.

For users that have recently been in the server, any badge for any experience can be queried, no matter who created the badge or which experience it is used for.

Rate limit is 50 + 35 * [number of players] per minute.

Roblox reference signature
BadgeService:UserHasBadgeAsync(userId: User, badgeId: int64): bool

Roblox documentation

Events

BadgeAwarded Supported Event
BadgeAwarded(string message, int userId, int badgeId)

No description available.

Roblox reference signature
BadgeAwarded(message: string, userId: int64, badgeId: int64)
Security: RobloxScriptSecurity

Roblox documentation

Inherited members

Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.

5 modern Roblox member(s) are not implemented yet — expand to inspect

Members declared by Roblox's BadgeService class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.

Methods

Member Signature Status Notes Flags
AwardBadgeAsync BadgeService:AwardBadgeAsync(userId: User, badgeId: int64): bool Not yet Award a badge to a player given the ID of each. Yields
CheckUserBadgesAsync BadgeService:CheckUserBadgesAsync(userId: User, badgeIds: Array): Array Not yet Checks a list of badge IDs against a UserId and returns a list of badge IDs that the player owns. Yields
GetBadgeInfoAsync BadgeService:GetBadgeInfoAsync(badgeId: int64): Dictionary Not yet Fetch information about a badge given its ID. Yields
GetUserBadgesAsync BadgeService:GetUserBadgesAsync(userId: User, badgeIds: Array): Array Not yet 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

Events

Member Signature Status Notes Flags
OnBadgeAwarded OnBadgeAwarded(userId: int64, creatorId: int64, badgeId: int64) Not yet — RobloxScriptSecurity

Roblox reference: BadgeService

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.