local J local Y local U=nil function GetTorso(J)local Y=game.Workspace:GetChildren()local u=nil local e=nil local Z=nil local V=nil local L=SearchDistance for l=1,#Y,1 do Z=Y[l]if Z:IsA("\077\111\100\101\108")and Z~=zombie then V=getHumanoid(Z)u=Z:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if u~=nil and(V~=nil and(V.Health>0 and V.Name~="\090\111\109\098\105\101"))then if(u.Position-J).magnitude<L then U=Z.Name e=u L=(u.Position-J).magnitude end end end end return e end function GetPlayersBodyParts(J)local Y=J if Y then local J=Y.Parent for J,Y in pairs(J:GetChildren())do if Y:IsA("\080\097\114\116")then return Y.Name end end else return"\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"end end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

local path
local waypoint

local chaseName = nil

function GetTorso(part)
	local chars = game.Workspace:GetChildren()
	local chaseRoot = nil
	local chaseTorso = nil
	local chasePlr = nil
	local chaseHuman = nil
	local mag = SearchDistance
	for i = 1, #chars do
		chasePlr = chars[i]
		if chasePlr:IsA("Model") and chasePlr ~= zombie then
			chaseHuman = getHumanoid(chasePlr)
			chaseRoot = chasePlr:FindFirstChild("HumanoidRootPart")
			if chaseRoot ~= nil and chaseHuman ~= nil and chaseHuman.Health > 0 and chaseHuman.Name ~= "Zombie" then
				if (chaseRoot.Position - part).magnitude < mag then
					chaseName = chasePlr.Name
					chaseTorso = chaseRoot
					mag = (chaseRoot.Position - part).magnitude
				end
			end
		end
	end
	return chaseTorso
end

function GetPlayersBodyParts(t)
	local torso = t
	if torso then
		local figure = torso.Parent
		for _, v in pairs(figure:GetChildren()) do
			if v:IsA("Part") then
				return v.Name
			end
		end
	else
		return "HumanoidRootPart"
	end
end
