Alright, so I want to sell 5 developer products, each for a different amount of in-game money. This is the script I use for all of them, of course I change the id and the local variable name.
local MarketplaceService = game:GetService('MarketplaceService') local devproductid2 = 81727674 --250 Credits MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == devproductid2 then player.leaderstats.Credits.Value = player.leaderstats.Credits.Value + 250 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
That one is for 250 money, but I have many of them, 100 money, 250, 500, 1,000, and 10,000
Please help, thank you!
Note I created a leaderstats