How to code a guild system?

Hi there!
I’m trying to code a clan system that saves, where players can create their own clan\guild with a name of their choice and invite people to join it.
The problem is I’m not sure on how to proceed. I’d prefer to use ProfileService since it’s a really good DataStore wrapper and it’s what I am already using it in my game to handle players’ data.
I’m struggling to design the system since the data isn’t attached to a single player, but multiple, so I’m assuming the clan data shouldn’t be tied to a single player or loaded when they join\leave.

Can someone give me a general idea on how to proceed? Pseudo-code is appreciated.

Define the inputs and outputs of your design first:

  • What information does the guild system need to provide (ie a guild members list to a GUI)
  • What systems chan modify the state of the guild, ie is there an AddMember function.
  • How will you check for changes to a guild, ie to update the GUI when a member is added or removed.