#1. You must be 21 to purchase ANY full auto firearm in the US. Full auto pistol, submachinegun, or belt fed Browning M2 50 cal. A machinegun is not a rifle or shotgun, falls under "other"- which is 21.
#2. You COULD buy a Beretta 93R once you are old enough, but not a Glock 18. Those were not registered before the cutoff date of May 1986. Sorry. BTW, the Law Enforcement version of the full auto Glock 18 sells for $509. CANNOT be transferred to a private citizen in the US.
#3 Continue to lust after that M4. You can buy an M16 with a shorty upper, but the TRUE M4A1 was first made AFTER May 1986. Again, cannot transfer to a private citizen. Sorry, Charlie....
What we have here is... failure- to communicate.