PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

PromptPurchaseFinished

Fires when a purchase is either denied or accepted.

For game passes, use MarketplaceService/PromptGamePassPurchaseFinished.

Parameters

Name Type Default Description

Code Samples


MarketplaceService.PromptPurchaseFinished

The below example would print ‘Telamon bought an item with AssetID: 1111’ to the output, if he were to complete a transaction in (your) game with an item that had an AssetID of 1111. Alternatively, it would print ‘Telamon didn’t buy an item with AssetID: 1111’ if the opposite was true.

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)