" Known Bugs:
-Aimbot aims on Teammates when they are in Range
(-Aimbot aims through walls) "
Firstly you need to do if statement (local team == entity team , continue).
Secondly it is not a bug. To prevent aims through walls you need to add Spotted check or write bps parser.