Faction System Help

Hey! I’ve been trying to work on a saving faction system, where you can create a faction, you can purchase it for cash, and you can invite players (and they stay in the faction unless they leave the faction or get kicked out), have faction info, ranking system, etc…

My issue is that I consider myself as an (almost) intermediate scripter and I don’t know where to start. I’ve looked for tutorials, but can’t seem to find any. I’ve also asked fellow developers who I know have made a faction system, but they’re too busy, and I understand that.

Here’s an example:
image (The Wild West Faction System)
DISCLAIMER: THIS UI/FACTION SYSTEM IS NOT OWNED BY ME, IM JUST USING IT AS AN EXAMPLE.

Anyway I’m not asking for a full on script, I just need help on where to start. Again, I’m fairly new to scripting, but I’m a pretty fast learner. Thank you in advance!

1 Like

I suggest you start by making the create faction and disband faction part, then renaming and ranking, and then everything other. This is because you want to start with the simplest and most important things that then contain smaller bits that you can/don’t have to make.

Hope this helps.

2 Likes

If you want it to save it you clearly want to use datastore. So what I would do:

FACTIONS CREATIONS

When someone creates a faction, put it in the ReplicatedStorage in a folder called Factions

  • Factions
  •         ↪ Baguette
    
  •                         ↪ Members
    
  •                                          ↪ Sarpomijon11
    
  •                                          ↪ Dragon_Breathe0831
    
  •                         ↪ Leader (Value) = Sarpomijon11
    

When a player leaves remove him from the Members list and when there’s no more member left delete the folder!

DATASTORE

When you leave the server you’re going to save in the datastore their faction they are currently in and probably their rank.

Example:

Sarpomijon11 - {[“Faction” = “Baguette” ; [“Rank”] = “Leader”]}
Dragon_Breathe0831 - {[“Faction”] = “Baguette” ; [“Rank”] = “Member”}

LOADING DATASTORES

When they are joining the server, automatically put them in the assigned faction.

pcall(function()
	local data = datastore:GetAsync(plr.UserId)
	
	local faction = data.Faction
	local rank = faction.Rank
	
	--Code here to assign them (Make a new folder with the faction's name in the Factions folder in ReplicatedStorage)
end)

This should be the basics of it, hope it helps :grinning_face_with_smiling_eyes:!

3 Likes

Yer i been working on one well learning to make one, however not many people have released them to get coding ideas to learn

2 Likes