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

7 comments

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.

0

Not at all! I think what he is wanting is a gamepass that give players in game currency when purchased.

0

@AdvancedCode Yes! I want to sell multiple developer products for robux, and give the players in game currency!

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?

0

Can you tell me the script? I'm not very good at scripting, I'm still learning.

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

0

Agreed.