local V=pfs:CreatePath()local L local B local U function findNearestTorso(V)local L=game.Workspace:children()local B=nil local U=Settings.WalkDistance.Value local A=nil local m=nil local X=nil for d=1,#L,1 do X=L[d]if X.className=="\077\111\100\101\108"and X~=script.Parent then A=X:findFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")m=X:findFirstChild("\072\117\109\097\110\111\105\100")if A~=nil and(m~=nil and(m.Health>0 and players:GetPlayerFromCharacter(m.Parent)~=nil))then if(A.Position-V).magnitude<U then B=A U=(A.Position-V).magnitude end end end end return B end
-- no touchy
local path = pfs:CreatePath()
local waypoint
local currentWaypointIndex
local target

function findNearestTorso(pos)
	local list = game.Workspace:children()
	local torso = nil
	local dist = Settings.WalkDistance.Value
	local temp = nil
	local human = nil
	local temp2 = nil
	for x = 1, #list do
		temp2 = list[x]
		if (temp2.className == "Model") and (temp2 ~= script.Parent) then
			temp = temp2:findFirstChild("HumanoidRootPart")
			human = temp2:findFirstChild("Humanoid")
			if
				(temp ~= nil)
				and (human ~= nil)
				and (human.Health > 0)
				and players:GetPlayerFromCharacter(human.Parent) ~= nil
			then
				if (temp.Position - pos).magnitude < dist then
					torso = temp
					dist = (temp.Position - pos).magnitude
				end
			end
		end
	end
	return torso
end
