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

Gamepass that gives you a badge doesnt gives the badge. Please help?

Asked by 3 years ago
Edited 3 years ago

everything seems to work fine and it even prints the badge has granted but the badge itself doesnt being awarded

local marketPlaceSetvice = game:GetService("MarketplaceService")
 local badgeService = game:GetService("BadgeService")
 local Players = game:GetService("Players")

local SupporterBadgeId = 2124763358
local Donate20Id = 18795242


 game.Players.PlayerAdded:Connect(function(player)

        hasPass = marketPlaceSetvice:UserOwnsGamePassAsync(player.UserId, Donate20Id)


    if hasPass then
        local playerId = player.UserId
        badgeService:AwardBadge(playerId, SupporterBadgeId)
    end
 end)

 local function onPromptGamePassPurchaseFinished(player, purchasePassID, purchaseSuccess)

    if purchaseSuccess == true and purchasePassID == Donate20Id then
        local playerId = player.UserId
        badgeService:AwardBadge(playerId, SupporterBadgeId)
        print("Badge has granted.")
 end
 end
marketPlaceSetvice.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished)

Answer this question