It's quite simple.
You have 2 variables in TriggerHappy's trigger:
- UnitArray.
Although the name of the variable could not be more obvious, I shall explain it: it is a variable with as type "unit" and it has an array.
- Point.
Also very obvious, it is a variable with as type "point" and does NOT have an array.
When a player chooses a unit/hero, you set that variable with as array the player number of the player who chose the unit/hero to the unit/hero he chose (complex sentence, I know).
A simple example:
set UnitArray[Player number of (Triggering Player)] = (last created unit).
Thus: you will store the unit inside a variable, every player will have its own hero stored inside this variable.
Then you literally do what TriggerHappy just did for you ^^
(The custom script and point are used to remove a leak, since leaks cause lag).
If you don't know what variables are (or how to use them correctly), or you're having problems with the loop, then you can ask us here.