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

3 comments
does it print (plr.Name)?
No. It doesn't print player.Name. Instead it prints the value, which it says is 0.
But the value of survived is over 10.