After trying to find scripts that would properly take care of accidently hitting people over the head with your weapon while trying to shoot, I just decided to make one that would fit my needs.
This is a simple FiveM script that removes the ability to melee with your weapon while scoped in. Which means that you won't accidently hit people while trying to shoot your weapon.
All you have to do is download the zip, and extract it into your server files. After that as long as you start the resource, no more accidents!