I looked into metatables and I'm not sure if I just didn't understand it or if it actually wasn't a viable option for this but if it is either post or comment howso. So I want to store tables within a table that will later be sorted by the first value of the table.
local teamRanking = {}
for _2, v2 in pairs(game.Players:GetChildren()) do
if v.TeamColor == v2.TeamColor then
--Removed code
table.insert(teamRanking, {tonumber(f.Level.Text),f.Name}) -- { Level Value, Player Name }
end
end
table.sort(teamRanking)
How would I go about fixing this so that the table.sort doesn't break once it tries to compare two table values?

1 comment
What criteria would you use to sort them...?