繁体   English   中英

尝试比较 nil < number?

[英]attempt to compare nil < number?

我试图改变以在客户端获取 zamount 的值,但它返回为零,有人可以帮忙吗?

脚本:

script.Parent.MouseClick:Connect(function(plr)
if plr.Team == game.Teams.Mastermind then
    local zombiespawn = script.Parent.Parent
    game.ReplicatedStorage.Events:WaitForChild("Onzombiespawnclick"):FireAllClients(plr,script.Parent.Parent.CFrame ,zombiespawn)
end
end)

本地脚本:

game.ReplicatedStorage.Events:WaitForChild("Onzombiespawnclick").OnClientEvent:Connect(function(spawncframe, zombiespawn)
script.Parent.Visible = true
zombiespawnreference = spawncframe

zombieamountreference = zombiespawn:FindFirstChild("Zombieamount").Value
end)




if zombieamountreference < game.ReplicatedStorage.Vals:WaitForChild("Zombieamountlimit").Value then
            if not debounce then
                debounce = true
                script.Parent:WaitForChild("Placeevent"):FireServer(zombiename, zombiespawnreference, power, zombieamountreference)
                wait(0.3)
                debounce = false
            end
        end

没关系,我必须在客户端事件参数上放置一个播放器对象。 它现在固定

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM