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

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.

01local MarketplaceService = game:GetService('MarketplaceService')
02local devproductid2 = 81727674 --250 Credits
03 
04MarketplaceService.ProcessReceipt = function(receiptInfo)
05    for i, player in ipairs(game.Players:GetChildren()) do
06        if player.userId == receiptInfo.PlayerId then
07            if receiptInfo.ProductId == devproductid2 then
08                player.leaderstats.Credits.Value = player.leaderstats.Credits.Value + 250
09            end
10        end
11    end
12    return Enum.ProductPurchaseDecision.PurchaseGranted
13end

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

0
I thought developer products only works with the Roblox currency of Robux. If you want to sell something with your in game currency you could just make a shop GUI. SimpleFlame 255 — 7y
0
Not at all! I think what he is wanting is a gamepass that give players in game currency when purchased. AdvancedCode 136 — 7y
0
@AdvancedCode Yes! I want to sell multiple developer products for robux, and give the players in game currency! R2D2yodayolo 32 — 7y
0
You'll just need to do elseif statements for any products following the purchase check of an item on line 7. That isn't difficult really, did you make this script or copy it from someone? M39a9am3R 3210 — 7y
View all comments (3 more)
0
Can you tell me the script? I'm not very good at scripting, I'm still learning. R2D2yodayolo 32 — 7y
1
You've got to do it yourself. You'll never learn if you don't try. Else-if statements are easy. Here's a basic code: if x then logic elseif y then logictwo elseif z then logicthree else logicfour end M39a9am3R 3210 — 7y
0
Agreed. AdvancedCode 136 — 7y

Answer this question