You can add teams in the scoreboard and turn off friendly fire. To make it lobby-only, set up a clock with two command blocks with the following codes:
scoreboard teams join (TEAMNAME) @a[(x-coord),(y-coord),(z-coord),r=(However big your lobby is)team=!(TEAMNAME)]
This command makes it so that everyone within r (the radius of your lobby) will be put on the same team
and
scoreboard teams leave @a[(x-coord),(y-coord),(z-coord),rm=(However big your lobby is),team=(TEAMNAME)]
This command makes it so that everyone out of the lobby is no longer on the same team.
Remove all parenthesis() and their contents with what you want to have in them.
The coordinates need to be the center of your lobby.
r and rm need to be the radius of your lobby.
TEAMNAME can be whatever you want it to. Just make sure it's the same throughout all your commands.
To set it up, do:
/scoreboard teams add (TEAMNAME)
and
/scoreboard teams option (TEAMNAME) friendlyfire false
thanks in advance
This command makes it so that everyone within r (the radius of your lobby) will be put on the same team
and
scoreboard teams leave @a[(x-coord),(y-coord),(z-coord),rm=(However big your lobby is),team=(TEAMNAME)]
This command makes it so that everyone out of the lobby is no longer on the same team.
Remove all parenthesis() and their contents with what you want to have in them.
The coordinates need to be the center of your lobby.
r and rm need to be the radius of your lobby.
TEAMNAME can be whatever you want it to. Just make sure it's the same throughout all your commands.
and
/scoreboard teams option (TEAMNAME) friendlyfire false
Try it out, see if it works.