1. Calculate the average x,y of all the player positions.
2. Set your camera position using the average position as the second parameter of the lerp.
Then to limit the player positions to the screen you could clamp the player positions.
So maybe something like this.
Global number camx=320
Global number camy=240
Every tick
— set camx to lerp(camx, (player1.x + player2.x)/2, 0.03)
— set camy to lerp(camy, (player1.y + player2.y)/2, 0.03)
—scroll to (camx, camy)
— player1: set x to clamp(self.x, camx-320, camx+320)
— player1: set y to clamp(self.y, camy-240, camy+240)
— ...do the same for player2
Notes:
320, 240 are half the viewport size 640,480. Change as needed.
The above does the average of two players. For three it would look like this:
(Player1.x+player2.x+player3.x)/3