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

How to sell developer products?

Asked by 6 years ago
Edited 6 years ago

So I have this script in my game, when you click a button gui, a prompt should appear and ask if you want to purchase the developer product.

Well, this doesn't work. The prompt does not appear. Any help? It's on a server script. Thanks.

local plr = script.Parent.Parent.Parent.Parent.Parent
local link = game:GetService("MarketplaceService")
deb = 0


script.Parent.MouseButton1Click:connect(function()
    local marketId = 102107544 --ID OF YOUR DEVELOPER PRODUCT  
    link:PromptProductPurchase(plr,marketId)
    link.ProcessReceipt = function(receiptInfo)
        if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
            if deb == 0 then
                deb = 1
                plr.leaderstats.Candy.Value = plr.leaderstats.Candy.Value + 100
                wait(1)
                deb = 0
            end
        end
    end
end)
0
The heck are you doing? ProcessReceipt can only be used once in a Server script... Thundermaker300 554 — 6y
0
It is used once in a server script...? Skepticlemon 24 — 6y
0
Thats bad to have serverscripts in a gui......... hiimgoodpack 2009 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Refer to this ROBLOX Wiki article here. This should help you a lot. Please accept my answer if this helped!

Ad

Answer this question