I have looked on most tutorials on youtube and the internet but I haven't found a working developer products tutorial. The tutorials work, however it only works for one developer product. The developer products are purchased through a GUI. Here's a script I gathered through everything.

Regular script:

local MarketplaceService = game:GetService('MarketplaceService')
local devproductid = 84413719

MarketplaceService.ProcessReceipt = function(receiptInfo)
	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
			if receiptInfo.ProductId == devproductid then
		player.leaderstats.Tokens.Value = player.leaderstats.Tokens.Value + 100
			end
		end
	end
return Enum.ProductPurchaseDescision.PurchaseGranted
end

Local script in a button:

local button = script.Parent
local devproductid = 84413719

button.MouseButton1Click:connect(function()
	game:GetService('MarketplaceService'):PromptProductPurchase(game.Players.LocalPlayer, devproductid)
end)

How would I change these scripts to make it use more developer products? I have no idea how to read most of the script.

2 comments

2

http://wiki.roblox.com/index.php?title=Handling_multiple_developer_products This page tells you how to make use of dictionaries (tables) to execute diffferent functions for multiple developer products. Read it so you can know how to set it up.

0

Thanks, this led to a tutorial that fixed everything.