There is going to be a problem with this, you didn't take into account you need to adjust for shooting offset so your results won't be accurate.
That's true, I need to do some minor tweaking with the script. As far as I know, it was tested with most semi-auto weapons and works well when the player is crouched.