Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function sortServers(servers, currentSort)
- if currentSort == "fastest" then
- table.sort(servers, function(a, b)
- return (a.ping or 9999) < (b.ping or 9999)
- end)
- elseif currentSort == "lowPlayers" then
- table.sort(servers, function(a, b)
- return a.playing < b.playing
- end)
- elseif currentSort == "maxPlayers" then
- table.sort(servers, function(a, b)
- return a.playing > b.playing
- end)
- end
- return servers
- end
Advertisement
Add Comment
Please, Sign In to add comment