function Zombie.moveTo(U)local j=false local H=U.Humanoid local A=U:FindPath()local Q Q=H.MoveToFinished:Connect(function(U)j=true Q:Disconnect()Q=nil if Shetchik<=5 then Zombie:moveTo()end end)if A~=nil then H:MoveTo(A)spawn(function()while not j do if not(H and H.Parent)then break end if H.WalkToPoint~=A then break end H:MoveTo(A)wait(6)end if Q then Q:Disconnect()Q=nil end end)end end return Zombie
--print("intmoveTO")

function Zombie:moveTo()
	local targetReached = false
	local humanoid = self.Humanoid
	local targetPoint = self:FindPath()

	local connection
	connection = humanoid.MoveToFinished:Connect(function(reached)
		targetReached = true
		connection:Disconnect()
		connection = nil
		if Shetchik <= 5 then
			Zombie:moveTo()
		end
	end)
	if targetPoint ~= nil then
		humanoid:MoveTo(targetPoint)

		spawn(function()
			while not targetReached do
				if not (humanoid and humanoid.Parent) then
					break
				end
				if humanoid.WalkToPoint ~= targetPoint then
					break
				end
				humanoid:MoveTo(targetPoint)
				wait(6)
			end

			if connection then
				connection:Disconnect()
				connection = nil
			end
		end)
	end
end

--print("Start")

return Zombie
