Target selecting markers with the return value of a function

E.g. i have 100 markers, and I have a player. I need to do some raycast functions to check if the markers can see the player. Then when I find some markers that fit these requirement, I need to choose the closest one to that player. Is there a way to do this?

Continue to help post