I tried following the wiki and example place but there still must be something wrong, because when someone buys the developer product in-game, I don't ever receive payment.
This script is in the Workspace:
MarketplaceService = Game:GetService("MarketplaceService") local ID = 19690897 local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") MarketplaceService.ProcessReceipt = function(receiptInfo) local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId if PurchaseHistory:GetAsync(playerProductKey) then return Enum.ProductPurchaseDecision.PurchaseGranted --We already granted it. end -- find the player based on the PlayerId in receiptInfo for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then -- check which product was purchased (required, otherwise you'll award the wrong items if you're using more than one developer product) if receiptInfo.ProductId == ID then -- handle purchase. In this case we are healing the player. player.leaderstats.Points.Value = player.leaderstats.Points.Value + 25000 end end end -- record the transaction in a Data Store PurchaseHistory:SetAsync(playerProductKey, true) -- tell ROBLOX that we have successfully handled the transaction (required) return Enum.ProductPurchaseDecision.PurchaseGranted end
And this is used to prompt the purchase after pressing a gui button:
MarketplaceService:PromptProductPurchase(player, 19690897)
First. ProductPurchase takes 1-24 Hours to load on your account with the money that they bought. Second. 19690897 is a Person's place.