Argument 1 missing or nil

I’m having this error popping up even though the argument in question exists, and can be read by print() (Edit: I’m trying to make an optimized version of my gun script)

function FireLoop()
	while equipped and firing and reloading == false do
		print(PM.Hit.Position)
		ARE:FireServer(PM.Hit.Position, workspace.CurrentCamera:WaitForChild(VM.Name):WaitForChild(wepeq.Name).Barrel.ShootThing.CFrame) -- This is where the error is, the argument in question (argument 1) exists
		firing = GunConfig.ShootType.IsAutomatic
		task.wait(60 / GunConfig.ShootType.RPM)
	end

	firing  = false
end

Hello. I’m sorry, but I have trouble identifying the issue here.

Either VM or wepeq are nil. Make sure they aren’t nil, this error is coming from WaitForChild.

I might need to see more of the script to help further.

PM (Which is GetMouse()) is missing or nil

VM Exists and wepeq exists, although the names that are associated in these variables are changing

here’s more of the script:

BE.Event:Connect(function(Equipped, truth)
	if truth then
		equipped = true
		wepeq = Equipped
		GunConfig = GunTable[Equipped].GunConfig
		VM = RS.VMs:WaitForChild(Equipped.."VM"):Clone()
		VM.Parent = Camera
		MRE:FireServer(wepeq, equipped)
	else
		equipped = false
		ViewModel = Camera[VM.Name]
		ViewModel:Destroy()

	end

end)