MarketplaceService PromptPurchaseFinished doesn't fire in localscript

The title says it all. I opened a new place, enabled Studio Access to API Services in the game setting. Next I created a dev product, Then I put in the wiki sample code for PromptPurchaseFinished in a local script like this.

local marketplaceService = game:GetService(“MarketplaceService”)

wait(5)
marketplaceService:PromptProductPurchase(game.Players.LocalPlayer, 106100108)

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)

PromptPurchaseFinished was triggering yesterday but today it is not triggering. I hope this issue can be fixed soon.

1 Like

Shouldn’t you be doing this from a server script?
Never trust the client.

2 Likes

I have it on the client not to process the purchase, but to update value displays on the gui after a purchase is done.

2 Likes

Catch PromptPurchaseFinished on the server and inform the client what to update. That’s what I would do at least.

This event still seems to fire locally for me when the purchase ui is gone. I just tested it in a local server less than a minute ago.

I also use this temporarily hide/show ui elements when I detect a purchase is about to be made and when the prompt has been closed.

In the mean time. Instead of using PromptPurchaseFinished in a localScript, I have my serverside product processing script fire at the client after a purchase is complete.

1 Like