How do i make gangs system?

  1. What do you want to achieve? Keep it simple and clear!
    I wanna make gangs system, but i don’t know how
  2. What is the issue? Include screenshots / videos if possible!
    No ideas lol
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked on youtube, dev hub, but i didn’t find anything good tutorial

Note: Im asking for a point, not a full script

2 Likes

I’d say the best way should be to simply make a team and add the players that join the gang to that team. As for creating the gang, a simple remote event like so:

event.OnServerEvent:Connect(function(plr, othervariables)
    if not plr.Team then --make sure they're not in a gang
        --create the gang
    end
end)

and I believe that’s all that is needed.

2 Likes

Nah it’s not just like i need a more better system. Like gangs leaderboards(by player amount), gangs which save(datastore), creating a gang(like there will be leader of gang), upgrading gang and etc. Not just team

2 Likes

Oh, sorry, I misunderstood. I would save the gang’s player amount through an ordered datastore and save what gang the player is in through a normal datastore you should probably also save a table of the id’s inside of that gang inside of a normal datastore. You would be able to get the top gangs by number of players inside of it through the ordered datastore.

2 Likes

Hmmm ok, but how to do gang creation and maybe upgrades

1 Like

As I said, for the gang creation, you should probably use a remote event, and for upgrades, save the upgrades used inside of the gang’s data table. The table should probably look something like this:

{
    ["People"] = {},
    ["Upgrades"] = {}
}
2 Likes

Ughhhh, this is so hard, but amma try atleast create smth. Also i can’t use teams because i have teams for other thing.

1 Like

Well, it doesn’t have to be a team, I just mean create it through the remote event.

3 Likes

Hmmm, but how?? Just like should i add a folder with ALL server gangs where will we a value with name of gang?

1 Like

Like every Servers gangs or just that specific server?

2 Likes

Every server gangs like in folder.

You don’t need to create a folder for it, just insert every created gang’s name into a table and save it in a data store.

local dss = game:GetService("DataStoreService")
local gangds = dss:GetDataStore("GangNames")
local gangs = {"gang1","gang2"}
gangds:SetAsync("key", gangs)

then you could simply retrieve it by

local dss = game:GetService("DataStoreService")
local gangds = dss:GetDataStore("GangNames")
print(gangds:GetAsync("key"))
2 Likes

Is this Script? Or Local Script?

This is a script, you can only access datastores through scripts. If you want to get it on the client, use a remote function, invoke the server, and have the server return the gangs.

Okay thanks lemme try that. (30 letters)

Hello so after a week of creating i finally work on that part, how do i should add GANGS to GANGS variable each time plr create a new gang?

So this is my script where i should get when player create gang

local GangCEvent = game.Workspace.GangsEvents.GangCEvent
local dss = game:GetService("DataStoreService")
local gangds = dss:GetDataStore("GangNames")
GangCEvent.OnServerEvent:Connect(function()
	print(gangds:GetAsync("key"))
	end)	

Im Guessing the one similar to Roblox Wild west

GLHF hope this helped you :smile:

I think no because i need a Entire servers gang system not on one server

I need to somehow save to datastore gangs names