There is only 8 elements within this table but when printed the list goes up to 10, with 2 of the spaces being nothing.
Code: local BTT = { – Buyable trails
RedTrail = {
"RedTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false,-- Owned
1, -- Table Position
50, -- Coin Cost
Color3.fromRGB(255,0,0)
};
BlueTrail = {
"BlueTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
2,
50,
Color3.fromRGB(255,0,0)
};
GreenTrail = {
"GreenTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
3,
75,
Color3.fromRGB(0,225,0)
};
YellowTrail = {
"YellowTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
4,
75,
Color3.fromRGB(255,255,0)
};
PinkTrail = {
"PinkTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
5,
100,
Color3.fromRGB(255,0,255)
};
CyanTrail = {
"CyanTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
6,
100,
Color3.fromRGB(0,255,255)
};
GoldTrail = {
"GoldTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
7,
1000,
Color3.fromRGB(255,200,0)
};
EmeraldTrail = {
"EmeraldTrail", -- Trail Name
"http://www.roblox.com/asset/?id=", -- Trail Image
false, -- Owned
8,
2500,
Color3.fromRGB(0,255,55)
};
}
local STT = {} – Sorted TrailTable
for i,z in pairs(BTT) do
table.insert(STT, z[4], z)
end
print(STT)
Result:
[1] =
{…},
[3] =
{…},
[4] =
{…},
[5] =
{…},
[6] =
{…},
[7] =
{…},
[9] =
{…},
[10] =
{…}
As you can see, 2 & 8 are missing for some reason. Please help as soon as possible, I’ve been totally stumped here.
