isn't there any way to do this in object editor, because it's not just a unit that will have this ability....there are at least 30 and i guess making this with a dummy will result in lag.
and what "yourvar" is used for? ("yourvar Equal to (Random integer number between 1 and 20)"