while wait()do local U=distance for C,y in pairs(workspace:GetChildren())do if y:FindFirstChild("\072\117\109\097\110\111\105\100")then if(y.Head.Position-script.Parent.Head.Position).magnitude<U then if y~=script.Parent then heardetect(y.Head)end else wander()end end end end
--launch
while wait() do
	local maxDistance = distance
	for i, v in pairs(workspace:GetChildren()) do
		if v:FindFirstChild("Humanoid") then
			if (v.Head.Position - script.Parent.Head.Position).magnitude < maxDistance then
				if v ~= script.Parent then
					heardetect(v.Head)
					--script.Parent.HumanoidRootPart.CFrame = CFrame.new(script.Parent.HumanoidRootPart.Position, v.HumanoidRootPart.Position)
				end
			else
				wander()
			end
		end
	end
end
