Hello, I’m having a problem that I literally have no idea where it comes from or how to solve it. What’s happening is that i have a regular table with 7 keys, and then I iterate through it. However, it doesn’t go through any index higher than 6 for some reason.
local Binds = {
[1] ={
["Type"] = Enum.UserInputType.Keyboard;
["Hold"] = false;
["Key"] = Enum.KeyCode.One;
["Name"] = "1",
["Trigger"] = function()
Modules.Control:Activated(1)
end
},
[2] ={
["Type"] = Enum.UserInputType.Keyboard;
["Hold"] = false;
["Key"] = Enum.KeyCode.Two;
["Name"] = "2",
["Trigger"] = function()
Modules.Control:Activated(2)
end
},
[3] ={
["Type"] = Enum.UserInputType.Keyboard;
["Hold"] = false;
["Key"] = Enum.KeyCode.Three;
["Name"] = "3",
["Trigger"] = function()
Modules.Control:Activated(3)
end
},
[4] ={
["Type"] = Enum.UserInputType.Keyboard;
["Hold"] = false;
["Key"] = Enum.KeyCode.Four;
["Name"] = "4",
["Trigger"] = function()
Modules.Control:Activated(4)
end
},
[5] ={
["Type"] = Enum.UserInputType.Keyboard;
["Hold"] = false;
["Key"] = Enum.KeyCode.Five;
["Name"] = "5",
["Trigger"] = function()
Modules.Control:Activated(5)
end
},
[6] ={
["Type"] = Enum.UserInputType.Keyboard,
["Key"] = Enum.KeyCode.LeftShift,
["Name"] = "Sprint",
["Hold"] = true,
["Trigger"] = function(Down)
Modules.Control:Activated("Sprint",Down)
end,
},
[7]={
["Type"] = Enum.UserInputType.Keyboard,
["Key"] = Enum.KeyCode.R,
["Name"] = "Equip",
["Hold"] = false,
["Trigger"] = function()
Modules.EquipItem:Equip()
end,
}
}
for Index,Bind in pairs(Binds) do
print(Index) -- 1,2,3,4,5,6
end