How would i create an In-Game party system?

So im curious as to how i would make a party system for in-game. Here is an example


Excluding the HP of the members, how would i create a party system that you can enter and exit and also invite other people?
Right now i got a scrollframe that adds all players ingame and u can click someone to invite them and it fires a remote to server than server fires remote to that client and the client does ui stuff and if the ui join is pressed it fires a remote back and forth (i send the name of the button the player pressed, aka the players name). Sadly this is unstable and exploitable, from what i know (i asked another coder) he said you could spam invite the whole server with this. I had to delete the old code and if someone knows how to make something like this, even a code example maybe? That would be cool, thanks.