Wanting to adjust fire rate as in burst mode

I would like to control the amount of bullets that fire then the weapon stops shooting unless bIsAutomatic = true but have it as a variable so I can choose 5, 3 etc. However I also wanna keep the feature of single shot weapon