I wrote an array where there are sub arrays.
local ShotgunsType = {
Prototype = {
{InstanceName = "PumpShotguns", Name = "Pump Shotguns"};
{InstanceName = "CombatShotguns", Name = "Combat Shotguns"};
{InstanceName = "DBShotguns", Name = "Double Barrel"};
{InstanceName = "MagShotguns", Name = "Magazine Shotguns"};
{InstanceName = "LeverShotguns", Name = "Lever Shotguns"};
{InstanceName = "LegendaryShotguns", Name = "Legendary Shotguns"};
};
benson = {
PumpShotgunsType = {
{InstanceName = "TypicalPumpShotgun", Name = "Typical Pump"};
{InstanceName = "CommonPumpShotgun", Name = "Common Pump"};
{InstanceName = "UncommonPumpShotgun", Name = "Uncommon Pump"};
{InstanceName = "LegendaryPumpShotgun", Name = "Legendary Pump"};
{UILocation = UI.ShotgunFrames.PumpShotgunsFrame};
};
CombatShotgunsType = {
{InstanceName = "TypicalCombatShotgun", Name = "Typical Combat"};
{UILocation = UI.ShotgunFrames.CombatShotgunsFrame};
};
DBShotgunsType = {
{InstanceName = "TypicalDB", Name = "Typical Double Barrel"};
{UILocation = UI.ShotgunFrames.DBShotgunsFrame};
};
MagShotgunsType = {
{InstanceName = "TypicalMagshotgun", Name = "Typical Magazine Shotgun"};
{InstanceName = "CommonMagShotgun", Name = "Common Magazine Shotgun"};
{InstanceName = "UncommonMagShotgun", Name = "Uncommon Magazine Shotgun"};
{InstanceName = "LegendaryMagShotgun", Name = "Legendary Magazine Shotgun"};
{UILocation = UI.ShotgunFrames.MagShotgunsFrame};
};
LeverShotgunsType = {
{InstanceName = "TypicalLeverShotgun", Name = "Typical Lever Shotgun"};
{UILocation = UI.ShotgunFrames.LeverShotgunsFrame};
};
LegendaryShotgunsType = {
{InstanceName = "LegendaryPumpShotgun", Name = "Legendary Pump"};
{InstanceName = "LegendaryMagShotgun", Name = "Legendary Magazine"};
{UILocation = UI.ShotgunFrames.LegendaryShotgunsFrame};
};
};
}
When I tried to print #ShotgunType.benson
, it should result in 6 because there are 6 sub arrays:
However, it results in 0, what’s the reason behind? I think I might have a misconception.