I tried to put the group name in the [array of units] but it doesnt seem to work.
That is because you need to put an array of units where it says, not a group. A group is not an array. However, to make an array of units out of a group, you need the
units command. Example:
{_x exec "crouch.sqs"} foreach units GROUP1
[EDIT]
Oh, and about your post a few posts ago:
_this = _this select 0
Don't ever try to assign a value to the _this variable. There is no need to ever do that. I suggest you read over some scripting tutorials and get a better grasp on what the _this variable really is in a script:
player exec "script1.sqs"
If I call a script in this way, then in that instance of "script1.sqs", the variable _this will equal the player:
_this -> player
[player, bob] exec "script2.sqs"
If I call a script this way, in that instance of "script2.sqs", then the variable _this will instead be an array, which contains the player, as well as "bob":
_this -> [player, bob]
The command "_this select 0" will return the FIRST ITEM in the array called _this:
_this select 0 -> [
player (0), bob (1)]
Notice the first item starts at index 0, the second is at index 1, etc.
So in summary, when you call a script, whatever you put before "exec", will be passed to the script in the variable _this:
[array] exec "script.sqs" -> _this => [array]
unit exec "script.sqs" -> _this => unit
11 exec "script.sqs" -> _this => 11
And so on. Most scripts require an array to be passed to the script, as in the first example, because an array can hold more than one unit of data. However, this is not a requirement. In the script I wrote you, there was only one thing the script needed to know: which unit to "run the script on", so I only require that you pass it that.