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

How to sell developer products?

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)

3 comments

0

The heck are you doing? ProcessReceipt can only be used once in a Server script...

0

It is used once in a server script...?

0

Thats bad to have serverscripts in a gui.........

1 answer

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

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