General > Developers Corner

Quetion about retrieving values

(1/1)

Schiaffino:
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: ---local tbl = player.GetAll()
table.sort(tbl, function(a, b) return (a:getDarkRPVar("kills") or 0) > (b:getDarkRPVar("kills") or 0) end)

--- End code ---

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

Thanks for the help <3

Navigation

[0] Message Index

Go to full version