It is possible make a Clan System?

I might make another game coming soon, and i thought about adding clans, but i don’t know nothing about how can i create them, since i want to identify when a clan name is already on use, or know when someone is on a clan, and that be stored in the clan. And i want to know if create a clan system is possible, if that’s possible, then how i could make it? Or any tips to create it? I hope you respond :+1:

5 Likes

ANYTHING IS POSSIBLE DIGITALLY! Well, there is limits, but hopefully you get the point.

If you’re new to programming/scripting I suggust you start with a more simpler task than this.

Here’s a list of things that’d probably be needed in order to create a clan system

  • Datastores
  • Remote Functions/Remote Events
  • UI for creating a new clan

Back end scripts can verify if a clan already exists, you should limit the ammount of times a player can create or try to create a clan as datastores have limits on call.

A Player creating a clan may look something like this: Player Clicks create clan on UI > Server Recieves request, returns back to player if filtering caught something (#s) also returns if clan already exists > Server Creates clan and saves it datastore > Player recieves response of successful clan creation.

Here are a few resources:
Remote Functions and Events
Datastores
Text and Chat FilteringYou must filter all text a player inputs if it’s going to be displayed to others
Debounce (When and why)

IT IS IMPORTANT THAT YOU USE REMOTE EVENTS/FUNCTIONS TO HAVE THE SERVER ACCESS THE DATASTORE, See Removal of Experimental Mode

I wish you best luck on your endeavour, if you have any questions please ask!

7 Likes

I saw the DataStore page over 20 times in total, and i still don’t know how to use them properly. Could you tell me how i can use it? I only know how to use them in leaderstats, not to save them in the entire game.

3 Likes

As long as you can quantify your ideas, it is possible to do anything. So depending on what you need the clan to feature, what you need varies. But obviously first and foremost is datastore. Storing players together that are within the same clan. I recommend looking up datastore2 by @Kampfkarren

1 Like

Youtube is going to be a better friend than devforums in terms of tutorials, as comments here are more useful as guiding points rather than full-blown tutorials.

2 Likes

That’s from 2015. I would highly advise staying away from that old of a video. Any information in it is likely to be outdated, and just from bouncing around a bit it’s already clear that it follows bad practices.

A couple of the problems with this specific video:
  • Using game.Players. :GetService is the proper way of accessing services, even if indexing it by name works.
  • Not pcalling functions that make web calls.
  • Using SetAsync to save default data when no data is saved. There’s really no reason to do this, I have no idea why he does.
  • Using SetAsync for incremental values. If a value only goes up, like Points would here, you should use UpdateAsync to make sure you’re only saving the higher value in case data doesn’t load properly.
  • It gives false information. If you reach the datastore limits, it will simply throttle your request. It doesn’t error.
  • This is more of a general complaint than a coding issue, but the audio desync in this video is makes it difficult to follow along with what he’s saying.

Of course, you can’t really expect much better from a video as outdated as 2015. There are plenty of videos out there that don’t have this issue, just be cautious to stay up to date.

4 Likes

For our games we use a modified version of DataStore2.

I recommended this video because the lack of proper practices makes it worse, but more beginner friendly. To an advanced programmer I would just recommend using DataStore2 and modifying it.

Quick aside: any modifications you make to DataStore2 must be open source as per the license.

3 Likes

u need to use DataStore and Chat Service to Filter, but if u want and a custom Clan id u can use game.HttpService:GenerateGUID(true) to have a better Clan id

What is GenerateGUID(true)? I never saw that or talked about it.

that generates random strings, if it is set true it will be like this:

3dk4]-4j34[-kfj}4{oks4}

Could you show me an example?

Also, there’s a chance that another clan gets the same id (lets talk about 0.0000000000000001 Chance)?

What you’re getting at is falsifiability, and I don’t think you should ever focus on dealing with something like that.

I want to mention that GenerateGUID will NEVER generate an identifier that has been occurred before for any purpose at all. This is due to how the generator works, it is not completely randomly putting letters and numbers together it is pseudo random. Read more about this here

1 Like

If you are worried about getting duplicate ids then you can try using datastores and incrementasync so that each new id is guaranteed to be a different number.

I don’t know how to use DataStores, and i already saw the dev hub and some youtube videos, but they didn’t work.

What I mean is you can try using IncrementAsync to make unique ids because you can start from 0 then increase it by one each time. If you don’t know how to use IncrementAsync then you can try looking at the code sample here: GlobalDataStore | Documentation - Roblox Creator Hub

1 Like

Ok, i read it and my question is how do i save it globally? The link you shared me, is saving a player’s value, but i don’t know how to save a game’s value (globally)

Just change the playerkey value so instead of using the userid you use a key that is always the same.

Alright, i already did it, now what i should do to create a basic clan system? I just learned how to use datastore.

Also, how do i increase the value in another script? for example, if you touch a block, that value will increase.

GenerateGUID doesn’t exactly generate a random mess, or rather it doesn’t do so for no reason. The function is used to generate a globally unique identifier (GUID) where in the case of generating a duplicate identifier is zero or negligibly closer to zero. These can be used for the sake of keeping information unique.

GUIDs are generated in the style 123e4567-e89b-12d3-a456-426655440000 with all letters being capitalised. Passing true as an argument for GenerateGUID will surround this identifier in curly braces, though true is the default behaviour so you don’t really need to do so yourself. False then, of course, will return your GUID without braces.

Read more on its documentation page: