I am trying to make a script which awards a badge when you buy a dev product, see anything wrong?
Asked by
4 years ago Edited 4 years ago
There are no errors that leaves me wondering why it doesn't award the badge. I requested help before and changed it accordingly, but for some reason, it still won't award the badge. It would help a lot if you see an error. Thanks.
01 | local badgeservice = game:GetService( "BadgeService" ) |
05 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
07 | local players = game:GetService( "Players" ) |
09 | local ProductID = 983895018 |
11 | local function processReceipt(receiptInfo) |
13 | local player = players:GetPlayerByUserId(receiptInfo.PlayerId) |
17 | return Enum.ProductPurchaseDecision.NotProcessedYet |
22 | badgeservice:AwardBadge(receiptInfo.PlayerId. UserId,id) |
25 | return Enum.ProductPurchaseDecision.PurchaseGranted |
31 | MarketplaceService.ProcessReceipt = processReceipt |