I went to the test place to try it out, and when I bought the sample product, it worked. So I created my own DP, and put the ID in the script. I joined a game, and when I clicked on the thing, and bought it, it said roblox was still doing maitmense on it. So... It was either that, or it was my coding.
-- setup local variables local MarketplaceService = Game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") local productId = "19320781"
-- define function that will be called when purchase finished MarketplaceService.ProcessReceipt = function(receiptInfo)
-- 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
if receiptInfo.ProductId == productId then
-- handle purchase. In this case we are healing the player.
MorePoints = player.leaderstats.Credits + 100
-- more feedback for the player.
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased a healing potion."
end
end
end
-- record the transaction in a Data Store
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end

5 comments
It will wont work
Where do you prompt the purchase?
I made the at one of my games. I'll give the link. I tried it again, and it worked, but it didn't give +100 Credits to my credits stats. http://www.roblox.com/Teston-place?id=146688974
Is 19320781 the correct product ID?
Yes. Its correct