Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Has Roblox done something to DevProducts again? (This used to work)

This script used to work about a month ago but now doesn't. I haven't changed it at all since then. It works on STUDIO with a test purchaseUI but not in game. Has Roblox updated something that I must change in this script? The game's output doesn't say anything in game nor does it say anything on studio.

donation1.MouseButton1Down:connect(function()
	local productId = 45544657 -- DevProduct Id (GIVES 10 ROBUX)
	MarketplaceService:PromptProductPurchase(player, productId)
	MarketplaceService.ProcessReceipt = function(receiptInfo)
		MarketplaceService:GetProductInfo(productId, Enum.InfoType.Product)
		wait(2)
		thankYou.Visible = true
		if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == player.userId then
			frame.LocalScript.MessageValue.Value = "[Server]: "..player.Name.." has just donated R$10!"
		end
	end
end)

1 comment

0

ProcessReceipt requires Enum.ProductPurchaseDecision.PurchaseGranted to be returned at some point.

1 answer

You may want to try the following:

  • Move your ProcessReceipt callback to outside of your Button1Down event. The function only need to be declared once, and should only be declared from one script.
  • The ProcessReciept function requires a ProductPurchaseDecision enumeration. From the wiki:
Note: If you fail to return PurchaseGranted after 3 days, the money from the transaction will be refunded to the buyer. It should also be noted that this callback should only be used in one server-side script, rather than several.
  • If this is a LocalScript, use a regular script.
  • If all else fails, add unique prints to each conditional part of your script. For example, you might want to add a print every time your click event runs, and if when you run the script and click on the button you do not get the message you put in the print, you can rule in that something is going wrong with your GUI. You might also want to add a print statement into the ProcessReciept, to make sure nothing is going wrong there. From this, you should be able to figure out what's going wrong.

If any of these helped you, please upvote and/or accept the answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.