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)
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 any of these helped you, please upvote and/or accept the answer.