How to make a Instance attack another Instance under the same object?

I have figured out how to make the bot attack the player but how do I make a bot attack an instance of its self?

Hi you can do it in various ways:

You can check the distance between the robots, and add an object variable like robot_is_attacking = false to the robots.
So when a robot is below some distance of other robot and is not attacking change the variable to true, ando do the attacking actions of the robots.

Other way is to add a new sprite and use it as line of sight of the robots so then check if that sprite is in collision with other robot and do the attack thing.