Developer product purchase not working?

local script triggers purchase

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
	local player = Players.LocalPlayer
	MarketplaceService:PromptProductPurchase(player, 1229353059)

process purchase server script in workspace

local MPS = game:GetService("MarketplaceService")

local pass = 1229353059

MPS.PromptPurchaseFinished:Connect(function(player, purchaseID, purchaseSuccsesfull)
	if purchaseSuccsesfull == true and purchaseID == pass then
		game.Workspace:SetAttribute("money", game.Workspace:GetAttribute("money") + 30)
		print("BOUGHT 30 COINS")

and nothing happens… nothing appears in the output window

The MarketplaceService.PromptPurchaseFinished event only fires for sales of gears/other assets (such as shirts). You might want to then switch to MarketplaceService.PromptProductPurchaseFinished, but the documentation very sternly warns you to NOT do that.

Using the MarketplaceService.ProcessReceipt callback is recommended instead. See the documentation for that here:

1 Like