So i am currently making a game, it has shooting and bullets involved. The single fire works well however when firing multiple times at once, it does not shoot all the bullets ( most of the time )

I tried to fix this using tables but it still did the same thing. Any fixes?

here is my code to see if you can find any flaws or oversights.

function shootingmod.Shoot(Model, Start, Target, Spread, Shots, Damage, Color, Range)
	local Rays = {}
	local Directions = {}
	for i = 1,Shots,1 do
		local Params = RaycastParams.new()
		Params.FilterType = Enum.RaycastFilterType.Blacklist
		local ModelDescendants = Model:GetDescendants()
		local BulletChildren = workspace.BulletHoles:GetChildren()
		local Meta = setmetatable(ModelDescendants, BulletChildren)
		Params.FilterDescendantsInstances = getmetatable(Meta)
		Params.IgnoreWater = true
		local Direction = CFrame.new(Start.Position, Target.Position) * CFrame.Angles(rad(random(-Spread, Spread)), rad(random(-Spread, Spread)), 0)
		local RayCastResult = workspace:Raycast(Start.Position, Direction.LookVector * Range, Params)
		table.insert(Rays, RayCastResult)
		table.insert(Directions, Direction)
	end
	for i = 1,#Rays,1 do
		local RayCastResult = Rays[i]
		local Direction = Directions[i]
		if RayCastResult then
			local Bullet = Instance.new("Part", workspace.Bullets)
			Bullet.Material = Enum.Material.Neon
			Bullet.Anchored = true
			Bullet.CanCollide = false
			if Color then
				Bullet.BrickColor = Color
			else
				Bullet.BrickColor = BrickColor.new("New Yeller")
			end
			local DistBetween = (Start.Position - RayCastResult.Position).magnitude
			Bullet.CFrame = Direction * CFrame.new(0, 0, -DistBetween)
			Bullet.Size = Vector3.new(.1, .1, DistBetween * 2)
			game.Debris:AddItem(Bullet, .025)
			local hum = RayCastResult.Instance:FindFirstChild("Humanoid", true)
			if hum then
				hum:TakeDamage(Damage)
			else
				local BulletHole = game.ReplicatedStorage.BulletHole:Clone()
				BulletHole.Parent = workspace.BulletHoles
				BulletHole.Position = RayCastResult.Position
				BulletHole.CFrame = CFrame.new(BulletHole.Position, BulletHole.Position + RayCastResult.Normal)
				game.Debris:AddItem(BulletHole, 35)
			end
		else
			local Bullet = Instance.new("Part", workspace.Bullets)
			Bullet.Material = Enum.Material.Neon
			Bullet.Anchored = true
			Bullet.CanCollide = false
			if Color then
				Bullet.BrickColor = Color
			else
				Bullet.BrickColor = BrickColor.new("New Yeller")
			end
			local DistBetween = Range
			Bullet.CFrame = Direction * CFrame.new(0, 0, -DistBetween)
			Bullet.Size = Vector3.new(.1, .1, DistBetween * 2)
			game.Debris:AddItem(Bullet, .025)
		end
	end
end