Need help with the purchases stats in my game

I need to create a system script that when someone buys a UGC item in my game the Purchases stat in the leaderboard increases by 1

MarketplaceService.PromptPurchaseFinished is probably what you’re looking for.

1 Like

yeah but when someone purchase the item, the Purchases stat in the leaderboard need to +1

player.leaderstats.purchases.Value = player.leaderstats.purchases.Value + 1

I won’t make you a full script.

local MarketPlaceService = game:GetService("MarketPlaceService")

MarketPlaceService.PromptPurchaseFinished:Connect(function(player, assetID, isPurchased)
        if isPurchased then
                -- +1 on leaderboard
        end
end)