I've set up a boolean to determine which team i'm in based on my cape. The script then recognises if there is a player in the area with the opposite team cape -> if yes, Attack nearest player.
Only problem is, if there are multiple players in the area and the closest player is from my own team then it will try to attack my own team.
Any suggestions?