foreach (var hero in ObjectManager.Get().Where(h => h.IsEnemy)) { Console.WriteLine(hero.Name + " is an enemy hero"); }
var player = ObjectManager.Player; var enemyHero = ObjectManager.GetThis code obtains a reference to the player's own hero, then uses ObjectManager to obtain a reference to the closest visible enemy hero within a certain range. If such a hero exists and is currently visible, their name is printed to the console. Package library: Riot Sharp.().FirstOrDefault(h => h.IsEnemy && h.Distance(player) < 1000); if (enemyHero != null && enemyHero.IsVisible) { Console.WriteLine(enemyHero.Name + " is visible on your screen"); }