(solved) Maximum range for "Pick the nearest"

How do I…

Make it so the “Pick the tree that is nearest to CastleX(), CastleY()” has a maximum range
and my sprite cant just go cut every tree from any distance

What is the actual result

Cuts every tree

alright, I fixed it by adding this
image