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

[fixed] Help me with ProcessReciept?

Asked by 10 years ago

PROBLEM: I accidentally had put an empty ProcessReciept somewhere else in the script, my bad!

When I purchase a developer product this won't fire! (the product simply won't trigger this at all!)

Can you see anything wrong with my code? The purchase happens in a localscript, The event is in a server script (this shouldn't effect it tho)

None of the prints go off

game:GetService("MarketplaceService").ProcessReceipt = function(receiptInfo)
    print("MADE IT!")
    for i,v in pairs(game.Players:GetPlayers()) do
        if v.userId == receiptInfo.PlayerId then
            print(v.userId .. "iuser")
            thePlay = v
        end
    end
    local player = thePlay
    print(receiptInfo.PlayerId .. "theplayerid")
    print(player .. "what player wegt")
    print(thePlay .. "whattheplayis")
    print(receiptInfo.ProductId.. " prod id")
    if receiptInfo.ProductId == 21929031 then
        player.leaderstats.Points.Value = PointsTable[player.userId] + 1000
        PointsTable[player.userId] = PointsTable[player.userId] + 1000
    end
    if receiptInfo.ProductId == 21929035 then
        player.leaderstats.Points.Value = PointsTable[player.userId] + 500
        PointsTable[player.userId] = PointsTable[player.userId] + 500
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted 
end

Answer this question