I have a Shop GUI, and a "Diamonds" tab. Straight forward. You click on the purchase button, you get the proper Dev Product ID, buy it, and get the diamonds. I made this script, but It doesn't work. I checked output, and it says nothing. Can anyone help with me?
local plr = script.Parent.Parent.Parent.Parent.Parent
local link = game:GetService("MarketplaceService")
debounce = false
devproductid = 84484960
script.Parent.MouseButton1Click:connect(function()
local marketId = devproductid
link:PromptProductPurchase(plr,marketId)
link.ProcessReceipt = function(receiptInfo)
if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
if debounce == false then
debounce = true
plr.leaderstats.Diamonds.Value = plr.leaderstats.Diamonds.Value + 200
wait(1)
debounce = false
end
end
end
end)

3 comments
ProcessReceipt must be done on the server and can only have one function connected to the event. ProcessReceipt must also return a value to confirm if the processing of the receipt is successful.
@kingdom5 I did it on the server, and it still doesn't work. So it's probably just the function one. I'll answer it if it works.
Can you update the question with the things you have changed.