Player Camera Locks onto nearest player direction

Hi, Im making a weapon which when equipped, keeps the player camera locked towards the nearest player. however, any information/tutorials that i have tried havent worked. Any help would be greatly appriciated!

You can run a loop that checks every players head position and finds the closest one, then you can change the cameras cframe to orient toward the players head position