Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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.

local badgeservice = game:GetService("BadgeService")

local id = 2124571648 --- Put Badge ID here

local MarketplaceService = game:GetService("MarketplaceService")

local players = game:GetService("Players")

local ProductID = 983895018 --- Product ID Here

local function processReceipt(receiptInfo) 

    local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then


    return Enum.ProductPurchaseDecision.NotProcessedYet 

    else


badgeservice:AwardBadge(receiptInfo.PlayerId. UserId,id)   


    return Enum.ProductPurchaseDecision.PurchaseGranted

end

---e 

MarketplaceService.ProcessReceipt = processReceipt
0
Do you have third party sales enabled that might be why it is not awarding the badges. cocajola3 6 — 4y

Answer this question