How do I break this loop

So basically I have a loop that just sets some stuff basically, I need to break the loop if the player goes farther then 15 studs from the target!

spawn(function()	
		while focused do
				local B = enemyhurmppos
				local A = hurmp.Position
				local offset = Vector3.new(5,1,0)
				local V = B + ((A + offset) - B).Unit * ((A - B).Magnitude + X)
				game.Workspace.CurrentCamera.CFrame = CFrame.new(V,B)
				hurmp.CFrame = CFrame.new(hurmp.Position, Vector3.new(enemyhurmppos.x,hurmp.Position.y,enemyhurmppos.z))
				game:GetService("RunService").Stepped:Wait()
			end
		end)
	end
end)

Check the distance, then use break.

Alright will do thanks Xueify!~