Hello!
I'm fiddling with a random gear script to use on a Project Opfor faction (LOP_US). So far everything works great, the ALiVE spawned units get random uniform, vest and headgear. However, the facewear (goggles) won't equip.
What is weird is that the script equips randomized eyewear/facewear for editor placed units, just not ALiVE spawned units. This is where I'm stuck.
Any insight on this would be much appreciated.
Script:
params ["_unit"];
if ((side _unit == EAST) && (vehicle _unit == _unit)) then {
_magazines = magazines _unit;
_items = items _unit;
_aItems = assignedItems _unit;removeAllItems _unit;
removeVest _unit;
_vests = ["","LOP_V_6Sh92_WDL","LOP_V_6Sh92_Radio_WDL","LOP_V_6Sh92_Radio_OLV","rhs_6sh92_digi_radio","rhs_6sh92_digi","rhs_6sh92","rhs_6sh92_radio","LOP_V_6Sh92_OLV","LOP_V_Chestrig_Kamysh","LOP_V_Chestrig_VSR","rhs_vydra_3m"];
_count = count _vests;
_unit addVest (_vests select floor random _count);removeUniform _unit;
_uniforms = ["LOP_U_US_Fatigue_09","LOP_U_US_Fatigue_06","LOP_U_US_Fatigue_07","LOP_U_US_Fatigue_14","LOP_U_US_Fatigue_12","LOP_U_US_Fatigue_03","LOP_U_US_Fatigue_11","LOP_U_US_Fatigue_10"];
_count = count _uniforms;
_unit addUniform (_uniforms select floor random _count);removeHeadgear _unit;
_headgear = ["","H_Cap_oli","H_Cap_grn","H_Cap_blk","rhs_beanie","rhs_beanie_green","H_Shemag_olive","H_ShemagOpen_tan","H_ShemagOpen_khk","H_Bandanna_gry","H_Bandanna_blu","H_Bandanna_cbr","H_Bandanna_khk"];
_count = count _headgear;
_unit addHeadGear (_headgear select floor random _count);removeGoggles _unit;
_goggles = ["","G_Shades_Green","G_Shades_Black","G_Bandanna_sport","G_Bandanna_beast","G_Bandanna_aviator","G_Aviator"];
_count = count _goggles;
_unit addGoggles (_goggles select floor random _count);{_unit addItem _x} forEach _items;
{_unit addMagazine _x} forEach _magazines;
{_unit addItem _x} forEach _items;
{_unit assignItem _x} forEach _aItems;};