-ami- mofo 13 Posted August 19, 2017 Hi guys, I already have this in my init.sqf which works fine on the damage handling of editor placed units. Quote if ( side _x == INDEPENDENT ) then { _x removeAllEventHandlers "HandleDamage"; _x addEventHandler ["HandleDamage",{ _damage = (_this select 2)*1.5; _damage }]; }; }forEach allUnits; What I'd like to do though is have any spawned units spawn with the same damage handling. Currently any units spawned have the default damage. I'm spawning units via the BIS fnc... Quote grp = [getmarkerpos "M1", independent, 6] call bis_fnc_spawngroup; grp Hoping it's an easy fix. Thanks. Share this post Link to post Share on other sites
rga_noris 3 Posted August 19, 2017 Since grp returns the created group by that function, just run the same loop on all units in that group (which is represented by the global variable grp in the script you provided). Since grp is overwritten by the most recent group created, as long as the forEach loop comes immediately after you should have no issues. Should look like this: grp = [getmarkerpos "M1", independent, 6] call bis_fnc_spawngroup; { _x removeAllEventHandlers "HandleDamage"; _x addEventHandler ["HandleDamage",{ _damage = (_this select 2)*1.5; _damage }];}forEach units grp; Share this post Link to post Share on other sites
-ami- mofo 13 Posted August 19, 2017 Thanks noris it worked perfectly. 1 Share this post Link to post Share on other sites