the example above could be shortened by not providing a slot variable or maybe creating an items list and have the script do the figuring out which goes where (i am not aware of how the engine does the attachments in a container because the scripting language does not have a command to handle this (http://feedback.arma3.com/view.php?id=21155)). this would solve the issue of keeping track of what attachments are on the weapon while in the backpack (but creates another issue where those attachments are persistent when re-added to backpack).