ProcessReceipt not working

  1. I want to print if the player bought an item

  2. im not getting anything not an error nothing

  3. i tried searching everywhere but couldnt find anything

promptPurchaseEvent.OnServerEvent:Connect(function(plr, id)
	mps:PromptPurchase(plr, id)
end)

mps.ProcessReceipt = function(receiptInfo)
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		print(player.Name.. " bought an item")
		return Enum.ProductPurchaseDecision.PurchaseGranted 
end

Thank you :smile:

1 Like

i fixed it with doing

local MarketplaceService = game:GetService("MarketplaceService")

local function onPromptPurchaseFinished(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

MarketplaceService.PromptPurchaseFinished:Connect(onPromptPurchaseFinished)