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)

8 comments
First, like I specified I have never received the payment....ever... That was 2 days ago by the way. Second, It's not someone's place I copied the ID directly: http://gyazo.com/279b259a766ec661718b81849e71eb96
You sure? http://web.roblox.com/jasant9s-Place-place?id=19690897
Did you look at my screenshot? It's the exact same ID. Also I forgot to mention that you gain the points from buying it ingame. The only problem is I don't get payment.
ProductIds are not the same as AssetIds. A ProductId can be the same as an AssetId.
OH ASSET, well in that case thats easy. You don't need scripts just a plugin! Get it off the roblox blog. It should be around where the winter games are about to start section
Okay who gave us both -1...
I just joined this website because nobody was helping on the forum so I don't know what that means.... So no idea why I'm not getting the payment?
Phhh, I came off the scripting forums they never help. So I went to lualearners they closed then I came here...