How to make a party system in your game

I want to make like a party system in my roblox game, the way I wanna do it is I have a game that chooses a random game on roblox so obviously the game is 1 player max. but I wanna create like a party system where someone can create a party by joining another place in the game where it is allowed to have for instance 4 players. But I was wondering how I should do it, I was thinking about let the creator of the party join a private server but then I cant use teleport to job instance… So my question is how should I teleport the creator and how should I make a script that the party creator can invite friends to that specific server? (in this server no one else can join)

1 Like

I reckon you will have to work with tables and storing Player objects inside them. If statements should be able to limit player count by using # operator.

Teleporting
https://developer.roblox.com/en-us/api-reference/class/TeleportService
https://developer.roblox.com/api-reference/function/TeleportService/TeleportPartyAsync
https://developer.roblox.com/api-reference/function/TeleportService/TeleportToPrivateServer

The last option should be the right function. It accepts a table of players.


Party invitation, management and functionalities lies in UI work where most of these are connected to the players table.

6 Likes

You would approach this by using tables, as @anon81993163 said, that contain player object elements. Using the three links provided, become familiar with the functions and events of the TeleportService. Then, to create a party, have the player create a new private server using an alternate place that contains a maximum of four players, and then use a global notification system to notify the other players that they are being invited. One would achieve this by using the MessagingService. The MessagingService allows players to communicate across servers in real time. Therefore, you would want to script a notification system using the MessagingService. You would want to specify the userid and the server id in the MessagingService request. Ideally, the notification system would send an invite to the desired player, and the player would receive this on the client end of the request. Upon receiving the notification, the player could either join the requester’s game, or simply ignore the request. Once a player accepts the requester’s invite, the TeleportService would use the information passed by the MessagingSystem to join the private server that was originally created. I hope this helps and made sense to you. Good luck!

4 Likes

Thanks alot for all the information, I will try to make this in the upcomming days and will post my results here in the forum. (If I found it)

1 Like