Machine Gun (help)

This may sound weird but how could I make a gun system and machine gun system like Trench Warfare (Trench Warfare - Roblox) made by J Cowboy Studios.

I’m just looking for ideas on how I could recreate the systems.

Thank you,
LuaGirlDeveloper