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

What does MarketplaceService.Prompt?PurchaseFinished do and How Do i get it to work

Asked by 4 years ago
Edited 4 years ago
local MarketplaceService = game:GetService("MarketplaceService")

MarketplaceService.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
    if isPurchased then
        print(player.Name .. " bought an item with AssetID: " .. assetId)
    else
        print(player.Name .. " didn't buy an item with AssetID: " .. assetId)
    end
end)

I have this code in a script in serverscriptstorage but it wont print anything for some reason

1 answer

Log in to vote
1
Answered by 4 years ago

It probably won't print anything because it's in ServerStorage. Put it somewhere else like ServerScriptStorage. Also, in the code that you gave, you did not prompt a player the gamepass. I'm pretty new to MarketPlaceService, so I might be wrong.

Ad

Answer this question