{"name":"setPylonLoadout","title":"setPylonLoadout","type":"command","url":"https://community.bistudio.com/wiki/setPylonLoadout","revid":378820,"updated":"2026-07-01T10:02:12Z","groups":["Vehicle Loadouts"],"status":"ok","games":{"arma3":"1.70"},"since":"arma3 1.70","arma3_since":"1.70","locality":{"argument":"local","effect":"local"},"description":"Adds/overrides loadout to a vehicle pylon. `TransportPylonsComponent` in vehicle config and `pylonWeapon` in the magazine config are required to run.\n\n> [!NOTE]\n> This command also adds the corresponding weapon if the vehicle does not have one, but will not remove one that is no longer used.","syntaxes":[{"syntax":"vehicle setPylonLoadout [pylon, magazine, forced, turret]","params":[{"name":"vehicle","type":"Object","type_expr":"Object"},{"name":"pylon","type":"Number or String","description":"pylon index (index starts from 1) or pylon name (see Example 1)","type_expr":"Number | String"},{"name":"magazine","type":"String","description":"magazine name","type_expr":"String"},{"name":"forced","type":"Boolean","optional":true,"default":"false","description":"true to force an incompatible magazine","type_expr":"Boolean","text":"forced: Boolean - (Optional, default false) true to force an incompatible magazine"},{"name":"turret","type":"Turret Path","optional":true,"default":"`[]`","description":"turret path","type_expr":"Turret Path","text":"turret: Turret Path - (Optional, default `[]`) turret path"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true on success"},"form":"binary","left":{"text":"vehicle"},"right":{"text":"[pylon, magazine, forced, turret]"}}],"examples":[{"code":["vehicle player setPylonLoadout [\"pylon1\", \"\"];"]},{"text":"Make all of your pylon weapons Twin Cannon 30 mm:\n\n```sqf\nprivate _vehicle = vehicle player;\nprivate _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 };\n{\n    _vehicle setPylonLoadout [_x, \"PylonWeapon_300Rnd_20mm_shells\", true];\n} forEach _pylonsIndices;\n```","code":["private _vehicle = vehicle player;\nprivate _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 };\n{\n\t_vehicle setPylonLoadout [_x, \"PylonWeapon_300Rnd_20mm_shells\", true];\n} forEach _pylonsIndices;"]},{"text":"Showcase all possible magazines:\n\n```sqf\n0 spawn {\n    private _allPylonMagazines = \"getText (_x >> 'pylonWeapon') != ''\" configClasses (configFile >> \"CfgMagazines\");\n    private _vehicle = vehicle player;\n    private _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 };\n\n    {\n        private _configName = configName _x;\n        {\n            _vehicle setPylonLoadout [_x, _configName, true];\n        } forEach _pylonsIndices;\n\n        hint _configName;\n        sleep 1.5;\n    } forEach _allPylonMagazines;\n};\n```","code":["0 spawn {\n\tprivate _allPylonMagazines = \"getText (_x >> 'pylonWeapon') != ''\" configClasses (configFile >> \"CfgMagazines\");\n\tprivate _vehicle = vehicle player;\n\tprivate _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 };\n\n\t{\n\t\tprivate _configName = configName _x;\n\t\t{\n\t\t\t_vehicle setPylonLoadout [_x, _configName, true];\n\t\t} forEach _pylonsIndices;\n\n\t\thint _configName;\n\t\tsleep 1.5;\n\t} forEach _allPylonMagazines;\n};"]},{"text":"MP compatible usage:\n\n```sqf\n[myPlane, [1, \"PylonWeapon_300Rnd_20mm_shells\", true]] remoteExec [\"setPylonLoadout\", myPlane];\n```","code":["[myPlane, [1, \"PylonWeapon_300Rnd_20mm_shells\", true]] remoteExec [\"setPylonLoadout\", myPlane];"]}],"multiplayer":"> [!IMPORTANT]\n> This command should run locally to the vehicle itself or it will cause desync issue! (especially upon the locality change, e.g getting in the vehicle).\n> See Example 4 for an MP-compatible usage.","see_also":["Arma 3: Vehicle Loadouts","getCompatiblePylonMagazines","getPylonMagazines","setAmmoOnPylon","ammoOnPylon","animatePylon","animateBay","setPylonsPriority"],"notes":[{"user":"POLPOX","date":"2020-04-30T13:01:00Z","text":"**Before Arma 3 v2.02:** *turret* must be `[]` if you wanted to equip the magazine to the pilot. `[-1]` returns false and fails unlike other turret-related commands."}]}