Roblox studio dev product buy connection problem

local purchaseCompleted = false

if currencyType == “Robux” then
local ProductId = LegendaryEgg[“DevProductId”]
local success, msg = pcall(function()
local Product = game:GetService(“MarketplaceService”):PromptProductPurchase(Player, ProductId)

  	--[[
  	game:GetService("MarketplaceService").PromptProductPurchaseFinished:Connect(function(player, assetId, wasPurchased)
  		if player == Player and wasPurchased and assetId == ProductId then
  			print("purchased!")
  			purchaseCompleted = true
  		end
  	end)
  	]]
  end)

  print(success)

end

if not purchaseCompleted then
return false
end

What am i trying to achieve?

  • Never scripted dev products before, i want to make a connection for it, and it will proceed only then that prompt purchased, is it a good idea? another way of solution?
1 Like

I believe what you are looking for is ProcessReceipt:

Note that you will need to use an if statement to check which product it is, and you can only have one occurance of ProcessReceipt in the scripts, otherwise excess ones are ignored

1 Like