API:Class/BadgeService

Server only:This service is server-side only! You should use a Script instead of a LocalScript when using it.
Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.
Uncreatable: This object cannot be created with Instance.new.

BadgeService.pngBadgeService : Object Icon.pngInstance

The BadgeService runs in a place to handle badges. When a player meets a certain requirement, the AwardBadge function can be called to give that player a badge. You can also check to see if a player has won a previous badge, even if it is not one of your badges.


YieldFunctions

YieldFunctions [toggle]

boolAwardBadge ( int userId, int badgeId )

Gives the player with user ID userId the badge corresponding to badgeId.

|RMD member="API:Class/BadgeService/AwardBadge"|Gives the player with user ID userId the badge corresponding to badgeId.|/RMD|
boolIsDisabled ( int badgeId )

Returns true if the badge is Disabled.

|RMD member="API:Class/BadgeService/IsDisabled"|Returns true if the badge is Disabled.|/RMD|
boolIsLegal ( int badgeId )

Returns true if the badge can be awarded. This will return true if the Badge associated with badgeId is part of the current place.

|RMD member="API:Class/BadgeService/IsLegal"|Returns true if the badge can be awarded.

This will return true if the Badge associated with badgeId is part of the current place.|/RMD|

boolUserHasBadge ( int userId, int badgeId )

Returns true if given user has the given badge.

|RMD member="API:Class/BadgeService/UserHasBadge"|Returns true if given user has the given badge.|/RMD|
AwardBadge ( int userId, int badgeId )
Gives the player with user ID userId the badge corresponding to badgeId.
IsDisabled ( int badgeId )
Returns true if the badge is Disabled.
IsLegal ( int badgeId )
Returns true if the badge can be awarded. This will return true if the Badge associated with badgeId is part of the current place.
UserHasBadge ( int userId, int badgeId )
Returns true if given user has the given badge.


|RMD member="API:Class/BadgeService"|The BadgeService runs in a place to handle badges. When a player meets a certain requirement, the AwardBadge function can be called to give that player a badge. You can also check to see if a player has won a previous badge, even if it is not one of your badges. |/RMD|