Ulysses

General => Developers Corner => Topic started by: Schiaffino on December 20, 2014, 12:16:22 PM

Title: Quetion about retrieving values
Post by: Schiaffino on December 20, 2014, 12:16:22 PM
Hello guys, well i think the title is not the correct huh... im sorry :S

Well i've been trying to make an small hud that spawn at the corner but im retrieving all the Player's online values, is there a way to retrieve the top 5? like show only the TOP 5 ?

here is part of my code:

Code: [Select]
local tbl = player.GetAll()
table.sort(tbl, function(a, b) return (a:getDarkRPVar("kills") or 0) > (b:getDarkRPVar("kills") or 0) end)

Is there a way to make it like only get first 5 values :C

Thanks for the help <3