{"name":"compatibleItems","operator":null,"title":"compatibleItems","type":"command","url":"https://community.bistudio.com/wiki/compatibleItems","revid":376857,"updated":"2025-12-08T20:38:25Z","groups":["Weapons"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.10"}],"since":{"game":"arma3","name":"Arma 3","version":"2.10"},"arma3_since":"2.10","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns all items (attachments) that can be mounted on the given weapon.","syntaxes":[{"syntax":"compatibleItems weapon","since":null,"effect":null,"exec":null,"params":[{"name":"weapon","type":"String","optional":false,"default":null,"description":"weapon class name","types":["String"],"since":null,"text":"weapon: String - weapon class name"}],"returns":{"type":"Array of Strings","types":["Array","String"],"description":"compatible attachments","text":"Array of Strings - compatible attachments"},"form":"unary","operator":null,"left":null,"right":{"text":"weapon","types":["String"]}},{"syntax":"compatibleItems [weapon, slot]","since":null,"effect":null,"exec":null,"params":[{"name":"weapon","type":"String","optional":false,"default":null,"description":"weapon class name","types":["String"],"since":null,"text":"weapon: String - weapon class name"},{"name":"slot","type":"String","optional":false,"default":null,"description":"class name of the slot (defined under **WeaponSlotsInfo** class in weapon config), for example:\n- \"CowsSlot\" for optics\n- \"MuzzleSlot\" for silencers\n- \"PointerSlot\" for laser pointers and flashlights\n- \"UnderBarrelSlot\" for bipods","types":["String"],"since":null,"text":"slot: String - class name of the slot (defined under **WeaponSlotsInfo** class in weapon config), for example:\n- \"CowsSlot\" for optics\n- \"MuzzleSlot\" for silencers\n- \"PointerSlot\" for laser pointers and flashlights\n- \"UnderBarrelSlot\" for bipods"}],"returns":{"type":"Array of Strings","types":["Array","String"],"description":"compatible attachments","text":"Array of Strings - compatible attachments"},"form":"unary","operator":null,"left":null,"right":{"text":"[weapon, slot]","types":["Array"]}}],"examples":[{"text":"```sqf\ncompatibleItems \"arifle_Katiba_GL_F\"; // [\"optic_Nightstalker\",\"optic_tws\",\"optic_tws_mg\",\"optic_NVS\", ...]\n```","code":["compatibleItems \"arifle_Katiba_GL_F\"; // [\"optic_Nightstalker\",\"optic_tws\",\"optic_tws_mg\",\"optic_NVS\", ...]"]},{"text":"```sqf\ncompatibleItems [\"arifle_Katiba_GL_F\", \"PointerSlot\"]; // [\"acc_flashlight\",\"acc_flashlight_broken\",\"acc_pointer_IR\", ...]\n```","code":["compatibleItems [\"arifle_Katiba_GL_F\", \"PointerSlot\"]; // [\"acc_flashlight\",\"acc_flashlight_broken\",\"acc_pointer_IR\", ...]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["compatibleWeapons","compatibleMagazines","BIS_fnc_compatibleItems","canAdd"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Weapons","Introduced with Arma 3 version 2.10","Scripting Commands"]}