I am making a game right now in roblox, and need to make gamepass store, however when my loop goes through it (its a table in table), it goes out of order
Example code with the tables in table
a = {
["5robux"] = {
value = 10,
name = "21"
},
["10robux"] = {
value = 13,
name = "31"
},
["15robux"] = {
value = 20,
name = "41"
},
["20robux"] = {
value = 25,
name = "64"
},
["61robux"] = {
value = 25,
name = "64"
},
["50robux"] = {
value = 3,
name = "64"
}
}
for i, v in pairs(a) do
print(i, v)
end
Output:
5robux ▶ {...} - Server - Script:30
50robux ▶ {...} - Server - Script:30
61robux ▶ {...} - Server - Script:30
20robux ▶ {...} - Server - Script:30
15robux ▶ {...} - Server - Script:30
10robux ▶ {...} - Server - Script:30
As you see, it firstly goes to the first element, then to the last and so on
How can i fix it, and whats wrong?
Tried changing the loop, but still wrong output