how can I sort tables within a table?
like that (Original table):
Sorted table:
(ordenating by lvl of secundary table..)
how can i do it?
thanks
like that (Original table):
Code:
local spells = {
--
{
instantName = 'Flame Strike',
words = 'exori flam',
lvl = 10,
mana = 20,
prem = false,
exhaustion = 1000,
groups = 1,
icon = 89,
needlearn = false,
vocations = {1,2,5,6},
},
--
{
instantName = 'Energy Strike',
words = 'exori vis',
lvl = 300,
mana = 20,
prem = false,
exhaustion = 10000,
groups = 1,
icon = 90,
needlearn = false,
vocations = {1,2,5,6},
},
--
{
instantName = 'Terra Wave',
words = 'exevo tera hur',
lvl = 30,
mana = 200,
prem = false,
exhaustion = 2000,
groups = 1,
icon = 91,
needlearn = false,
vocations = {1,2,5,6},
},
--
}
Sorted table:
Code:
local spells = {
--
{
instantName = 'Flame Strike',
words = 'exori flam',
lvl = 10,
mana = 20,
prem = false,
exhaustion = 1000,
groups = 1,
icon = 89,
needlearn = false,
vocations = {1,2,5,6},
},
--
{
instantName = 'Terra Wave',
words = 'exevo tera hur',
lvl = 30,
mana = 200,
prem = false,
exhaustion = 2000,
groups = 1,
icon = 91,
needlearn = false,
vocations = {1,2,5,6},
},
--
{
instantName = 'Energy Strike',
words = 'exori vis',
lvl = 300,
mana = 20,
prem = false,
exhaustion = 10000,
groups = 1,
icon = 90,
needlearn = false,
vocations = {1,2,5,6},
},
--
}
(ordenating by lvl of secundary table..)
how can i do it?
thanks