我更新了我的销售脚本以包含双倍现金游戏通行证,但现在它不起作用,有人可以尝试修复它吗?

问题描述 投票:0回答:0

我有一个可以工作的销售平台,但现在没有错误消息,但不卖我的鱼。

    local Part = script.Parent
local id =158043842
Part.Touched:Connect(function(hit)
    local H = hit.Parent:FindFirstChild("Humanoid")
    if H then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            local leaderstats = player:WaitForChild("leaderstats")
            local currency = leaderstats.Coins
            local selling = leaderstats.Fish
            
            if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
                if selling.Value > 0 then
                    currency.Value = currency.Value + selling.Value * 2
                    selling.Value = 0
                end
            else
                if selling.Value > 0  then
                    currency.Value = currency.Value + selling.Value * 1
                    selling.Value = 0
                end
            end
        end
    end
end)

这是一个脚本,不是本地脚本,它位于销售平台内。

roblox simulator
© www.soinside.com 2019 - 2024. All rights reserved.