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

MarketplaceService.PromptPurchaseFinished

MarketplaceService.PromptPurchaseFinished

Oct 01 2018, 2:12 AM PST

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)