Kydoimos 916 Posted February 12, 2015 Hi all - having some trouble with assigning a variable to a spawned group. Basically, here's a spawned group: _CSAT_Group_01 = [[3398.35, 7003.95, -75.95], EAST, ["O_Officer_F","O_Soldier_PG_F","O_Soldier_PG_F","O_Soldier_PG_F","O_Soldier_PG_F","O_Soldier_PG_F","O_Soldier_PG_F","O_Soldier_PG_F"],[],["CAPTAIN","SERGEANT","CORPORAL","PRIVATE","PRIVATE","PRIVATE","PRIVATE", "PRIVATE"],[],[],[],-200] call BIS_fnc_spawnGroup; Now, for some reason, I can't run a forEach command on this group outside of the script I've created them in. Here's a separate script: Sleep 6; { unassignVehicle _X; _X action ["EJECT", _Kajman_01]; Sleep 2.25; } forEach (units _CSAT_Group_01); { _X action ["openParachute", _X]; Sleep 0.5; } forEach (units _CSAT_Group_01); Sleep 20; { deleteVehicle _X } forEach (units _CSAT_Group_01); Unfortunately, it can't find _CSAT_Group_01 - the group created in the first script. If I were to run the above from the script with the spawned group function however, there's no problems. Where am I going wrong? :D A noob error, I don't doubt! Sure one of you bright sparks can help though! Share this post Link to post Share on other sites
fight9 14 Posted February 12, 2015 What you have there is a local variable. Having the underscore at the beginning of "_CSAT_Group_01" means that it does not exist outside of the script its defined in. Try using "CSAT_Group_01" instead. Share this post Link to post Share on other sites
Kydoimos 916 Posted February 12, 2015 @Fight9 - ah, thanks mate! I understand completely now! :P Share this post Link to post Share on other sites