Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this say that the "survived" stat is 0 even though it isn't?

Asked by
AronYstad 101
3 years ago

I have this function that runs in a 60 second loop in a script in game.Workspace. But instead of printing the value of "survived", it prints "0". Does anybody know what I have done wrong?

function difficultyincrease()
    local players = game.Players:GetChildren()
    for i = 1, #players do
        local player = players[i]
        if player.leaderstats.Survived.Value > 10 then
            print(player.Name)
        else
            print(player.leaderstats.Survived.Value)
        end
    end
end
0
does it print (plr.Name)? DisastrousFate 0 — 3y
0
No. It doesn't print player.Name. Instead it prints the value, which it says is 0. AronYstad 101 — 3y
0
But the value of survived is over 10. AronYstad 101 — 3y

Answer this question