How can you reliably know that a PromptBulkPurchase was successful on the server?

I am currently creating a clothing game and I’m a little confused about this new method in the MarketplaceService. I’m using the PromptBulkPurchase method to allow players in my game to buy all their selected clothing items to be bought at once. However, as far as I know, no way to tell on the server if someone bought the clothing items through the bulk purchase.

There is an event for the client however I want to increase their “spent” leaderstats value so I need to make sure exploiters can’t just send false events. Thus I’m wondering if there’s a way for the server to detect when someone buys something through the PromptBulkPurchase method.

I think you want to use the MarketplaceService.PromptBulkPurchaseFinished event.

game:GetService('MarketplaceService').PromptBulkPurchaseFinished:Connect(function(Player, Status, Results)
    if Status == Enum.MarketplaceBulkPurchasePromptStatus.Completed and game:GetService('MarketplaceService').PlayerOwnsAsset(Player, 'asset id here' then
        print('They have the asset!')
    else
        print('They don\'t have the asset.')
    end
end)

You have to check if they own the asset with the .PlayerOwnsAsset function because the client can spoof the PromptBulkPurchaseFinished event.

Hope this helps!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.