It is not illegal to make your own gun as long as the gun is intended for personal use and has a detachable metal part. Since most ghost guns are created by a 3D printer, the material the gun is made from is plastic and will not set off metal detectors. To be considered legal, ghost guns must have a metal plate or other components installed to set off a metal detector.