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

Can anyone tell me why this is processing the receipt, but failing to load the character? Thanks.

Asked by 4 years ago
local MPS = game:GetService("MarketplaceService")
local function processReceipt(receiptInfo)
    if receiptInfo.ProductId ==  961264618 then
    local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId) 
        if not player then
            --player left game
            return Enum.ProductPurchaseDecision.NotProcessedYet
        end
    print(player.Name.." just bought "..receiptInfo.ProductId)
    player:LoadCharacter()
    return Enum.ProductPurchaseDecision.PurchaseGranted
    end
end

MPS.ProcessReceipt = processReceipt()

Answer this question