AcquireAssetFinished

格式

AcquireAssetFinished(Player,AssetId,wasPurchased)

简介

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

实例

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

wait(0.5) 
local player = Players:GetLocalPlayer() -- 获取本地的玩家对象
local AssetId = 450931 -- 获取资源Id

MarketExchangeService.AcquireAssetFinished:Connect(function(player,AssettId,wasPurchased)
        print(string.format("玩家[ %s ],wasPruchased:--[ %s ],购买了id为[ %s ]的资源",
                player.Name,tostring(wasPurchased),AssetId))
    end)

wait(3)
MarketService:AcquireAsset(player, AssetId) -- 提示玩家去购买id为AssetId的资源
文档更新时间: 2020-07-11 17:26   作者:孙晓艺