How to sort by level?
Right now I'm trying to sort a list of players by their level that is in their player
01 | SortByLevel = function () |
03 | for k,v in ipairs (game.Players:GetChildren()) do |
04 | repeat wait() until v:FindFirstChild( "Level" ) |
05 | table.insert(tab, { v.Level.Value,v.Name } ) |
08 | for i = #game.Players:GetChildren(), 1 , - 1 do |
09 | local n = tostring ((#game.Players:GetChildren() - (i- 1 ))) |
10 | body:FindFirstChild(n).Text = n.. ". " ..tab [ n ] [ 2 ] |
So I get the error saying that the line where it sets the text is indexing a nil value, how do I fix this? I'm sure this is some simple solution I just have never made a leaderboard before...