Warning: file_put_contents(/ff_84f91477d12eeae0b62a6e585c01609879ddec94bab4a4a9.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
addWeaponGlobal - OFPEC Scripting Command Reference | OFPEC The Editing Center

unitName addWeaponGlobal weapon

Operand types

unitName: Object
weapon: String

Type of returned value


Add a weapon to a unit.

Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command will replace the weapon currently in a slot with the added weapon if it shares the same slot.
To make sure the added weapon is loaded and ready, add the magazine first.

Global in multiplayer.

Used In



{_x addMagazineGlobal "Laserbatteries"; _x addWeaponGlobal "Laserdesignator"} forEach allUnits;