Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my Dev Product Script not working for my Shop Gui?

Asked by
Jxemes 75
6 years ago

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)
1
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.  User#5423 17 — 6y
0
@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. Jxemes 75 — 6y
0
Can you update the question with the things you have changed. User#5423 17 — 6y

Answer this question