So what i’m trying to do is set some random numbers from high to low in a table,
its all the players xp in a table and the highest number will add the player to the top of the leaderstats and the lowest will add them to the bottom,
Local AllPlayersXpInOrder = {}
Local XpExample = {35, 42, 35, 29, 52, 35, 25, 45, 14, 45, 23, 63}
Local number = 500
while number ~= 0 do wait()
for i, v in pairs (XpExample) do
if v > number then
table.insert(AllPlayersXpInOrder, #AllPlayersXpInOrder + 1, v)
table.remove(XpExample, i)
break
end
end
number = number - 1
end
This is what i have but i am concerned that if a player xp is larger than number then it will not set that large number in order, and if i set number to 1000 for example or more it will take to long to finish setting the table in order