Warning: file_put_contents(/ff_38f4e5cd6304d08f350f0cdfba5a5df8d47d7a1ac185ff0f.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;