InfantryChild 10 Posted January 12, 2015 I've been struggling with this for hours. This is part of a spawning script, and the code is by default being passed to all units being spawned. I want to limit it to a certain class, and have other loadouts for other classes. This is all within the EOS script. I want a specific unit class to be given this script, but not others, within my loadout script. //I NEED SOMETHING HERE TO LIMIT THIS TO A SPECIFIC UNIT CLASS _unit addHeadgear _RandomHeadgear; _unit addWeapon _RandomWeapon; _unit addGoggles _RandomGoggles; _unit addVest _RandomVest; _unit forceaddUniform _RandomUniform; //Add Magazines _unit addMagazines ["30Rnd_9x21_Mag", 6]; } forEach (units _grp); Share this post Link to post Share on other sites
mikey74 169 Posted January 12, 2015 what class? here is a snippet from one of my scripts maybe it will help a bit: { _Ucheck = _x; _type = typeOf _Ucheck; _displayname = getText(configfile >> "CfgVehicles" >> _type >> "displayName"); if (_displayname == "Ammo Bearer") then { what ever you want}; } forEach (units _grp); Share this post Link to post Share on other sites
jshock 513 Posted January 12, 2015 Encapsalte the entire thing with an if statement: if (typeOf _unit isEqualTo "Classname") then { //stuff }; Share this post Link to post Share on other sites