简体   繁体   中英

attempt to compare nil < number?

Im trying to change to get the zamount's value in the client side but it returns it as nil, can anyone help??

script:

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)

Local script:

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

Nevermind, i had to put a player object on the client event parameter thing. Its fixed now

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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