-- Module 2

function NpcModule.RayY(X,Z,Npc)
	local rayY = Ray.new(Vector3.new(X,Npc:GetPivot().Y * 2, Z), Vector3.new(X, -(Npc:GetPivot().Y * 4), Z))
	local Pos = workspace:FindPartOnRayWithIgnoreList(rayY, RayYIgnore)
	if Pos ~= nil then
		if Pos.CanCollide == false then
			table.insert(RayYIgnore, Pos)
			NpcModule.RayY(X,Z,Npc)
		else
			if table.find(RayYIgnore, Pos) then
				table.remove(RayYIgnore, table.find(RayYIgnore, Pos))
			end
			return Pos.Position.Y
		end
	end
end


