We are making some changes to how badges work. What this means for you is that whenever you create a badge, you will now need to start using these new Lua APIs instead of the ones you are accustomed to; otherwise they may not function correctly. After July 16th, all new badges that get created will not be assets and must use these new methods.
The existing APIs will continue to work for all existing badges to avoid breaking games.
Checking badge ownership
To check if a player owns a badge, use BadgeService:UserHasBadgeAsync().
The old method BadgeService:UserHasBadge() was initially meant to be specific to badges, and we realize it is commonly used to check asset ownership. In order to avoid breaking games, we had to create a new method.
Getting badge information
Use BadgeService:GetBadgeInfoAsync() as a replacement for MarketplaceService:GetProductInfo()
This new method exposes the following fields:
- Icon image Id
- Whether or not the badge is enabled
MarketplaceService:GetProductInfo() is intended for items that have products (sellable items,) and a badge cannot be sold so we felt it made more sense to create a new method on BadgeService.
Let us know if you have any questions or concerns!