purchaseSuccess

This event fires when a purchase dialog for a pass is closed. It fires as the dialog closes, when the player presses "Cancel" at the prompt or "OK" at the success/error message.

marketplace.purchaseSuccess(callbackFunction: function): void

marketplace.purchaseSuccess(function(, purchaseType: Enum, wasPurchase: Boolean)
    -- Enum.PurcahseType GamePass | MemberShip | Product
    -- wasPurchase only returns for GamePasses and Product not MemeberShip
    if purcahseType == Enum.PurcahseType.GamePass then
        print(player.Name .. " purchased a gamepass")
    elseif purcahseType == Enum.PurcahseType.Product then
        print(player.Name .. " purchased a product")
    else
        print(player.Name .. " purchased a membership")
    end

end)

Last updated