Sometimes a rifle is the best tool for the job. A shooter with skill and accuracy can aim the weapon and put the bullet right where he wants it to go.
Then again, there’s the shotgun approach; just aim the weapon in the general direction you want to fire and pull the trigger. The pellets spread out in a broad pattern, and you hope that one or more of them strike the target, giving you the result you hoped for or needed. As long as that happens, it doesn’t matter much that the rest of the pellets missed.