Would be easier if we could use mousex/y serverside.
You could do
NPC Code:
with (players[testplayer(mousex,mousey)])
if it was serverside.
I suppose you could check for mousedown on the clientside, triggeraction the mouse coordinates, then do
NPC Code:
with players[testplayer(strtofloat(#p(0)),strtofloat(#p(1)))])