Can someone help me out? a Random.NextInteger function is returning nill everytime i run it
the function returning the nill
local Tables = GetTablesFromAttackAnimation1(AttackFrameModule, (CanBackstab and AttackFrameModule.BackstabAnimation) and "BackstabAnimationTable" or RealType, AttackNumber)
local Table = Tables[Random.new():NextInteger(1, #Tables)]
print(Table)
LastComboDelay = Table[3][2]
the function itself
local function GetTablesFromAttackAnimation1(AttackFrameModule, AttackType, Attack)
local Tables = {}
print(Attack)
for _, v in pairs(AttackFrameModule[AttackType]) do
if v.AttackType == Attack then
print("oi2")
table.insert(Tables, {v.Id, v.Speed,
{v.AttackDelay, v.ComboDelay, v.HitboxTimes, v.RaycastHitboxInstances},
{v.DashDelay, v.DashVelocity, v.DashLifeTime},
{v.Hitbox.HitboxType, v.Hitbox.HitboxShape, v.Hitbox.HitboxSize, v.Hitbox.HitboxCFrame, v.Hitbox.MaxPartsInRegion}})
end
end
return Tables
end
the table
{
Id = "rbxassetid://9518474867", Speed = 1, AttackDelay = 0.6, ComboDelay = 0.6, HitboxTimes = {0, 0.5}, RaycastHitboxInstances = {{"Tool", "Handle"}}, DashDelay = 0, DashVelocity = 1, DashLifeTime = 2, AttackType = "1",
Hitbox = {
HitboxType = "RaycastHitbox",
--RotatedRegion
HitboxShape = Enum.PartType.Block,
HitboxSize = Vector3.new(4, 4, 7),
HitboxCFrame = CFrame.new(0, 1, -2),
MaxPartsInRegion = 50,
}
},

1 comment
Not the cause of the error, i have a function without the "and, "or" and it gives me the same error