Well, you need to pick up on the -ar being typed by player 1.
Then you will probably need a Unit Array with every single hero on it, each taking one element.
With a random number generated, you create a "copy" of the hero on the map using the index in the array.
That's how you would do it in theory.