--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
