Added canAttack(Player) function

canAttack(Player ply) checks if the player is in range and returns true or false depending if they are in range.