How to make a gun with a ammo reload

how do i make a gun and ammo work if you know plzz make a example and send me the link so i can see

Search HALOALO THE GAME. I didn’t make it but it has a very complicated reload system with math in it.