The short of it is, I don't recieve money on purchase.
What I have running, in ServerScriptService, as a Server-Sided Script:
-- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
-- 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
player.Teleport.Value = false wait() player.Teleport.Value = true
end
end
-- record the transaction in a Data Store
local playerProductKey = receiptInfo.PlayerId .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
This was copied from the demo place I found in the Roblox Wiki (http://www.roblox.com/Developer-Product-Sample-place?id=147965737).
the local 'playerProductKey' (line 14) used to be longer, but used to produce errors: 'key is too long' or something.
Shortening that fixed the errors, but still it won't pay me.
Please tell me if you see something that may cause this to not work.

1 comment
https://scriptinghelpers.org/questions/8139/why-doesnt-this-product-code-grant-me-profit#10581