raid6n
(Raiden)
#1
Hey! Let’s say I have a dictionary like this:
local dictionary = {
Part1 = "2",
Part2 = "7",
Part3 = "18",
Part4 = "1",
Part5 = "4"
}
How could I make a script that sorts it into:
local dictionary = {
Part4 = "1",
Part1 = "2",
Part5 = "4",
Part2 = "7",
Part3 = "18",
}
sjr04
(uep)
#2
The dictionary part of a table has no notion of order. Use an an array instead.
raid6n
(Raiden)
#3
Okay, if I were to insert all the values inside of the array, how could I sort it?
uhi_o
(HAT3UBERALLES)
#4
You can use this concept here.
Placing it all in an array then putting it back in a Dictionary sorted.
Edit: Also found this online
1 Like
raid6n
(Raiden)
#5
LOL! Hi, uhi_o. Thanks, it worked.
1 Like