OOP Party System V2

Hey everyone! I am super excited to release OOP Party System V2, a reworking of my V1 Party System. This release contains a whole bunch of new improvements and functionality in an attempt to make it easier, stronger, and more flexible for player party managing in your game.
Let me know if you see any missing information, or have anything I could improve upon :slight_smile: I have attempted to test all functions, and test for issues but I cannot test for them all. So let me know if you find any please!

Full documentation can be found here

Get the full OOP Party System V2 - Model from this link.

What’s in This Module?

This is a universal player party system based on functions such as leadership, invitations, permission, blacklist, and teleportation. Version 2 is a package of everything in the first, enhanced error management, enhanced event management, and more streamlined functionality.

Major Revisions since Version 1

This version is an improvement on the first, making some substantial improvements.

  • Automatic error handling: Functions now return true on success and false on error with explanatory alerts.

  • Enhanced Event Support: Custom Event module based event system replaces outdated onInviteSent callback. Extend events OnMemberJoined, OnDisband, and OnInviteExpired in a convenient way.

  • Remote Handling Enhancement: The client-server communication is handled by a RemoteHandler module, which includes new methods such as InvitePlayerByUsername and AcceptInvite.

  • Unique IDs for parties: Parties now have a reference ID using GetPartyById.

  • New Functions: Added LeaveParty, InvitePlayerByUsername, SetPartyName, and ClearBlacklist, among lots of others, for improved flexibility.

  • Type Safety: Strict Lua type annotations for enhanced code readability and IntelliSense.

  • Better Member Control: Separates voluntary leaving (LeaveParty) and expulsion (RemoveMember), event-notified through OnMemberLeft.

Automatic Remote Function and Client Methods

OOP Party System V2 automatically creates a RemoteFunction named PartyRemoteFunction in ReplicatedStorage when the module initializes, handled by the Remotes module. This remote function enables seamless client-server communication, allowing clients to invoke server-side party management methods. Here are the methods you can call via PartyRemoteFunction:InvokeServer from the client:

  • CreateParty – Creates a new party for the calling player.

  • InvitePlayer(player: Player) – Invites a specified player to the caller’s party (requires CanInvite permission).

  • AcceptInvite(partyId: string) – Accepts an invite to join a party with the given party ID.

  • LeaveParty – Allows the calling player to leave their current party (if not the leader).

  • KickMember(member: Player) – Kicks a specified member from the caller’s party (requires CanKick permission and leadership).

  • TransferOwnership(newLeader: Player) – Transfers party leadership to a specified member (requires current leadership).

  • ToggleInviteOnly(toggle: boolean) – Sets whether the party is invite-only (requires leadership).

  • SetMaxMembers(maxMembers: number) – Sets the maximum number of party members (requires leadership).

  • DisbandParty – Disbands the caller’s party (requires leadership).

  • SetPermission(member: Player, permission: string, toggle: boolean) – Sets a permission (e.g., “CanKick”, “CanInvite”) for a member (requires leadership).

  • RevokeInvite(player: Player) – Revokes a pending invite for a specified player (requires CanInvite permission).

  • SetPartyName(name: string) – Changes the party’s name (requires leadership).

  • GetParty(targetPlayer: Player) – Retrieves the party of a specified player; returns success (boolean) and the party object.

Feedback or Questions

I’d love to hear your thoughts, suggestions, or bug reports! Feel free to reply here or contact me via Roblox messages.

16 Likes

You have no idea how perfect your timing was on this. Thank you

4 Likes

Scrolling through the code and the documentation, this is impressively thorough and well-considered. The API seems very intuitive (plenty of useful, clearly named methods and events without parameter bloat). This looks really nice!

3 Likes

iv been observing the code and saw your event module. the module is pretty simple, but its very un-optimized. you can optimize it by doing this:

  • making a linked list instead of using normal list.
  • another way is to make a optimized thread spawner.

if any questions, ask me or anyone else. love the module!

1 Like

:slight_smile: hope you find it useful! Let me know if you think anything should be added.

1 Like

This is just not true, and while the suggestions you offered may be relevant small tune-ups, this criticism paints this module in an unnecessarily bad light for anyone who doesn’t know better. Those suggestions are micro-optimizations that will have miniscule to no noticeable impact on either the server or the client. This module does no heavy lifting and is basically a logic controller. That’s to say that it doesn’t do enough stuff (e.g., heavy computation, frame by frame processing, etc.) for even a series of micro-optimizations to propagate into a noticeable improvement.

1 Like

this is not only about optimization, this is about the usage of the module. if you connect an event from this module 2 times, the first one can delay the other one from running if it ever yields. this is not it. if you have a lot of connections to one signal, it can increase lag for low end devices which could be fatal for the player base of the game. the module it self is great, but im just giving a tip.

Yes, a yielding function could delay subsequent callbacks (if the callbacks aren’t coroutines or scheduled thread). However, that doesn’t begin to qualify the module as “very un-optimized”. It’s a simple fix for either OP or anyone integrating it into their projects (they don’t even have to modify the actual module). You also shouldn’t worry excessively about connections to a Signal (for a still short, but more thorough explanation I’d refer you one of the engineer’s comments: Do connected functions run relatively at the same time? - #2 by WallsAreForClimbing)

Like I said before, I’m not disagreeing that the suggestions you offered may be relevant small tune-ups. However, calling the module “very un-optimized” paints it (unfairly) in a bad light. Nothing in this module is going to drop the performance of a game. As mentioned before, even if a bound function yields, that’s actually more user-error than poor design. If people want to insulate the module against themselves passing yielding functions (or if OP wants to do it) that’s their choice, but not actually a significant point against the module.

(Realizing this is starting to detract the thread - if you want to chat more I’m happy to continue someplace else)

I have some things i want to reference which you completely misunderstood after what i understand:

  • I have never said the module is very unoptimized. I said the event module is very unoptimized, and it was not to hate or anything, im just giving a tip

  • I only gave some things which could help improve the “event module”, not the main module. I just want to make it clear that the module itself is pretty good, but i have made a signal before, and thought it could be helpful to help others

This is not any hate towards you or the module, just want to contribute to make this module good. Hope we can get this over with. Tell me if there is something you might disagree with. and i would love to talk to you another place. Have a great day!

1 Like

Hi,
Thanks for sharing this.

  1. Does the party only exist in game, or does it data save, so if you leave and come back the next day you are still in the party? I do not need this, just wondering…

  2. Is the invite only for your Roblox friends, or can you invite other players to your party that are not in your roblox friend list?

  3. Can this be used to create like a squad of 4 players?

  4. Does it have other things like you cannot damage players on your team?

  5. Is there any private messaging to your people in your party?

  6. Is there a testing EDITable place to check out?

Thanks

  1. No, it has no built in data saving functionality. It only exists physically under the module in the folder for that server. You could use a datastore system to make it save though.
  2. Invite only is meant to work as like the AddMember method only works on the passed player if they have an active invite for that party. If they do not, it would give back a warning instead of adding them. I had actually forgot to add the check for IsInviteOnly to the AddMember method, so you asking this helped fixed a bug lol.
  3. You could use it in that way, yes. Example usage would be lots of things, like even a lobby system because a teleport function is built it. Party system similar to rivals, etc.
  4. No, nothing like that is built in. You would have to use the built-in methods to detect the parties and stop the damage if they are within the same one.
  5. No, not built in. Would have to be scripted yourself again, would be fairly simple though hopefully with all the built-in methods.
  6. Not as of now, this is a good idea though. I will work on making one soon and add it to the thread. I will respond to you when it is added.

Thanks for the info.

I am still unclear about the answer on item 2) , can you only invite your Roblox friends? Or can other non roblox friend join your party if they get an invite?

  1. Does the invite system have a gui that lists the players you can invite and you click on them to do the invite?

I will check it out when there is a .rbxl,
thanks

No, not have that built in. However, you could add that feature yourself if desired. I may add it to the module as a pre-set soon though.

  1. No, it has no UI attached to it, just the pre-made remotes you can call. You’d have to script UI yourself. The rbxl file may come with a basic UI when I add it.