Shared by Happybro on May 15, 2016

Thanks to Quackdot for his great post on Reddit. Here is the transcription:

The random attachment multidimensional array exists in the DayZ gamefiles (addonsweapon_firearms.pbo), it looks like this (from the Skorpian gun):


This contains two arrays, both arrays have different purposes for different slots of the gun.

In the above example the first array is for the barrel slot and the second is for the magazine slot.

How the probability is calculated

From what I assume how the attachment system works, it will pick a random item from the array for each weapon slot.