I am wondering how to do this. I checked the wiki, but it was all very confusing. I got 4 dev products so far, and like it says in wiki only 1 works.
Local Script
local MarketplaceService = game:GetService("MarketplaceService") local buyButton = script.Parent local productId = 104751988 player = game.Players.LocalPlayer buyButton.MouseButton1Click:connect(function() MarketplaceService:PromptProductPurchase(player, productId) end)
Server Script:
local MarketplaceService = game:GetService("MarketplaceService") local productId = 104751988 MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == productId then player.leaderstats.Money.Value = player.leaderstats.Money.Value +500 return Enum.ProductPurchaseDecision.PurchaseGranted end end end end
Im wondering if its possible to name these each something different, like maybe MarketplaceService:PromptProductPurchase2(player, productId).
If there is no easier way, i guess ill just do what it says in wiki. Thanks if you help!