Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with MarketplaceService please? [Still UnAnswered]

Asked by
hiccup111 231 Moderation Voter
10 years ago

The short of it is, I don't recieve money on purchase.

What I have running, in ServerScriptService, as a Server-Sided Script:

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

MarketplaceService.ProcessReceipt = function(receiptInfo)
    MarketplaceService.ProcessReceipt = function(receiptInfo)

        for i, player in pairs(game.Players:GetChildren()) do
            if player.userId == receiptInfo.PlayerId then
                player.Teleport.Value = false
                player.Teleport.Value = true
            end
        end

        local playerProductKey = receiptInfo.PlayerId .. receiptInfo.PurchaseId
        ds:IncrementAsync(playerProductKey, 1)

        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
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.

Answer this question