finished checkNPCdistance autobot function