function Zombie.moveTo(d)local M=false local b=d.Humanoid local f=d:FindPath()local t t=b.MoveToFinished:Connect(function(d)M=true t:Disconnect()t=nil if Shetchik<=5 then Zombie:moveTo()end end)if f~=nil then b:MoveTo(f)spawn(function()while not M do if not(b and b.Parent)then break end if b.WalkToPoint~=f then break end b:MoveTo(f)wait(6)end if t then t:Disconnect()t=nil end end)end end return Zombie


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

