Thanks for the response. This would select the player closest to me IN my viewcone WHEN we can trace a line to him.. which is almost what i want. However if the player has 3 players in line of sight (viewcone+traceline) it should be obvious to him which one will be the target of the spell. The troubles im having is selecting the best target, i.e the target closest to his aim. I know how to do in teory but i can't get the code to work properly.
I see you're edited your post

- And yes that's what i want, but im not sure what playera,b is?