AcquireSubscriptionFinished

格式

AcquireSubscriptionFinished(Player,SubscriptionId,wasPurchased)

简介

当购买游戏订阅的弹窗关闭或玩家取消购买或购买失败时,本事件触发,并将购买记录存到SubscriptionPurchasedRecord,如未购买或取消或购买失败,则不会记录

实例

local MarketService = GetService("MarketExchangeService") --获取内购服务

wait(0.5) 
local player = Players:GetLocalPlayer() -- 获取本地的玩家对象
local SubscriptionId = 221 -- 获取订阅Id

MarketExchangeService.AcquireSubscriptionFinished:Connect(function(playerId,SubscriptionId,wasPurchased)
        print(string.format("玩家[ %s ],wasPruchased:--[ %s ],购买了id为[ %s ]的订阅",
                player.NickName,tostring(wasPurchased),SubscriptionId))
    end)

wait(3)
MarketService:AcquireSubscription(player, SubscriptionId) -- 提示玩家去购买id为SubscriptionId的订阅信息
文档更新时间: 2020-07-14 13:03   作者:胡慧俊