Attempt to index nil with "Connect" (FastCastRedux)

Okay so I’m trying to make my own gun using Fast Cast, but I ran into a problem, where it says: “Attempt to index nil with “Connect”.”

Here’s is the script:

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local fireEvent = tool:WaitForChild("Com")
local FastCast = require(tool:WaitForChild("FastCastRedux"))
local firePoint = handle:WaitForChild("GunFirePoint")
local rs = game:GetService("ReplicatedStorage")

local bulletFolder = rs:WaitForChild("BulletFolder")
local IceBullet = bulletFolder:WaitForChild("IceBullet")

local caster = FastCast.new()

local castParameters = RaycastParams.new()
castParameters.FilterType = Enum.RaycastFilterType.Blacklist
castParameters.IgnoreWater = true

local castBehavior = FastCast.newBehavior()
castBehavior.RaycastParams = castParameters
castBehavior.AutoIgnoreContainer = false
castBehavior.CosmeticBulletContainer = bulletFolder
castBehavior.CosmeticBulletTemplate = IceBullet

function onEquipped()
	
	castParameters.FilterDescendantsInstances = {tool.Parent}
	
end

function onLengthChanged(caster, lastPoint, direction, length, velocity, bullet)
	if bullet then
		
		local bulletLength = bullet.Size.Z/2
		local offset = CFrame.new(0,0, -(length - bulletLength))
		bullet.CFrame = CFrame.lookAt(lastPoint, lastPoint + direction):ToWorldSpace(offset)
		
	end
	
end

function fire(plr, mousePos)
	
	local origin = firePoint.WorldPosition
	local direction = (mousePos - origin).Unit
		
	caster:Fire(origin, direction, 150, castBehavior)
end

fireEvent.OnServerEvent:Connect(fire)

tool.Equipped:Connect(onEquipped)

caster.LengthChanged:Connect(onLengthChanged)

The issue is on the last line, but I don’t see anything that should make it happen.

Can you check to see what the value of caster actually is? Try adding this before the last line, it should spit out a bunch of extra info into the output:

print(caster)
print(getmetatable(caster))
if caster.LengthChanged then
    print(getmetatable(caster.LengthChanged))
end

And then post here what gets printed into the output.

Okay so I found out the issue, the module i got had some failures in them, i fixed them and now it works, I actually did this myself and saw the issue. But thanks anyways!