{"name":"setPylonLoadout","operator":null,"title":"setPylonLoadout","type":"command","url":"https://community.bistudio.com/wiki/setPylonLoadout","revid":378820,"updated":"2026-07-01T10:02:12Z","groups":["Vehicle Loadouts"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.70"}],"since":{"game":"arma3","name":"Arma 3","version":"1.70"},"arma3_since":"1.70","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"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]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicle: Object"},{"name":"pylon","type":"Number or String","optional":false,"default":null,"description":"pylon index (index starts from 1) or pylon name (see #Example 1)","types":["Number","String"],"since":null,"text":"pylon: Number or String - pylon index (index starts from 1) or pylon name (see #Example 1)"},{"name":"magazine","type":"String","optional":false,"default":null,"description":"magazine name","types":["String"],"since":null,"text":"magazine: String - magazine name"},{"name":"forced","type":"Boolean","optional":true,"default":"false","description":"true to force an incompatible magazine","types":["Boolean"],"since":null,"text":"forced: Boolean - (Optional, default false) true to force an incompatible magazine"},{"name":"turret","type":"Turret Path","optional":true,"default":"`[]`","description":"turret path","types":["Turret Path"],"since":null,"text":"turret: Turret Path - (Optional, default `[]`) turret path"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true on success","text":"Boolean - true on success"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[pylon, magazine, forced, turret]","types":["Array"]}}],"examples":[{"text":"```sqf\nvehicle player setPylonLoadout [\"pylon1\", \"\"];\n```","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.","problems":null,"aliases":[],"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."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Vehicle Loadouts","Introduced with Arma 3 version 1.70","Scripting Commands","Scripting Commands: Local Effect"]}