This lock on system is not final, Ive also brought the volume down so its not super loud during testing.
Simply, this lock on system works by shooting out a ray cast when the mouse button is held down, when the ray cast hits a target, it adds that target to a list . From that list, the Bullets amount you fire will equal that number of targets that is in that list. When you let go of the mouse button, it then shoots out the bullets , that will only track the target enemy.
again this is not final, and this video is to help keep track of progress.