How do I make 5 developer products?
Asked by
7 years ago Edited 7 years ago
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.
01 | local MarketplaceService = game:GetService( 'MarketplaceService' ) |
02 | local devproductid 2 = 81727674 |
04 | MarketplaceService.ProcessReceipt = function (receiptInfo) |
05 | for i, player in ipairs (game.Players:GetChildren()) do |
06 | if player.userId = = receiptInfo.PlayerId then |
07 | if receiptInfo.ProductId = = devproductid 2 then |
08 | player.leaderstats.Credits.Value = player.leaderstats.Credits.Value + 250 |
12 | return Enum.ProductPurchaseDecision.PurchaseGranted |
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