Ethridge 15 Posted January 18, 2016 Hello, im making a addon that adds new units, and I want them to spawn with random weapons, drawing from a pool of certain weapons, how would I do this? It needs to be done internally in the addon. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 21, 2016 _newGroup = createGroup blufor; _unit = _newGroup createUnit ["className", _somePosition, [], 0, "NONE"]; _allWeapons ["M16A2", "M16A2GL", "m16a4", "M4A1", "M4A1_AIM_CAMO", "G36A", "G36C"]; _weapon = _allWeapons select floor random count _allWeapons; _unit removeWeapon primaryWeapon _unit; _unit addWeapon _weapon; This code is untested though and I couldn't come up with a generic solution for adding the correct magazines, but I hope this helps as a starter. Also, if you're trying to do this in MP, notice that in ArmA 3 there are command called removeWeaponGlobal and addWeaponGlobal, so I wouldn't assume that removeWeapon and addWeapon remove/add the weapon globally in ArmA 2. Share this post Link to post Share on other sites
Ethridge 15 Posted January 21, 2016 Thanks! How do you recommend I run this? It would need to be internally in the addon. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 21, 2016 Well, you write your addon adds new units. I don't know what code your addon already consist of, so I can't really make a precise statement, but simply put this code where you would create/add the unit. Share this post Link to post Share on other sites