Hello, I discovered that tables (not arrays) get sort up randomly, this is a problem for me as my script wont work because of this.
If you did not fully understand what I mean here’s a picture of whats happening:
My output prints this while it should print:
As you can see the order of table values and keys are totaly messed up.
System Information:
MacBook Pro 2019, MacOS 15.3.0
Expected behaviour:
It should just print and return itself the table provided in the image before.
I guess another method that can be utilized is something like the following:
local Fruits = {
Kinds = {"Apple", "Pear", "Orange"},
Colors = {"Red", "Green", "Orange"}
}
for n = 1, 3 do
print(Fruits.Kinds[n], "is the color", Fruits.Colors[n])
end
That way no matter how the two are mis-matched, you’ll have some sort of order to them.