You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Make a social feed where users can share posts. (filtering enabled ofc)
What is the issue? I am not sure how I would go about doing this.
What solutions have you tried so far? I have looked for solutions. None found.
What do you think the best way of doing ordereddatastore and saving “Name” “Title” and “Message.” Or would I not use ordereddatastore? Please let me know what I could do to save posts throughout servers and randomize which ones show up.
" A OrderedDataStore is essentially a GlobalDataStore with the exception that stored values must be positive integers. "
You would want to use Something Like datastores or memory stores. I don’t know enough about your system and how it works to tell you more then just to use a Normal datastore / Memory store
Well you can fetch the data like normal, and use something like:
local AllDataList = {"Example 1", "Example 2"}
local RandomResult = math.random(1, #AllDataList)
print(RandomResult) --Example 1 **or** Example 2 is printed
You should be able to randomize it yourself using some lines of code after the data is received
Ok! So… could I save that data somewhere that it could be checked from any server anytime and be saved so when the game is completely shutdown it will save.
You will want to Use again, a Normal data store or a Memory Store. Each have their own Perks. Datastores are meant for session saving so when you leave and rejoin, your data is still there. Memory stores allow for quick transfer of data but is more meant to disappear after everyone left the entire game. Again you haven’t explained any of the system to me and what your attempting to do. I can assume but I have no clue other then you mentioned OrderedDataStores which wouldn’t work for storing strings
This is totally possible. You can make almost anything in Luau
I was attempting to do this with ordered datastore, but I dont have much experience there. What datastore type would I use to do this. Again, I have no system, so whatever you think best, please let me know.
I’m not asking for the script or what you think you should do, as you wouldn’t make this forum post for that very issue. I’m asking what are you trying to do/make.
All the information I have is:
And the title.
I need you fully explain your system, in what you are trying to do and Trying to make.
And you will want to use a DataStoreService:GetDataStore() , aka a Normal Default Datastore. We Only Use OrderedDataStores for leaderboards, where the order matters, and It uses Numbers.
I am trying to make a system where players can make posts. The posts will appear in other players feeds. So, lets say I want to advertise my group, I would make a post saying “I make games! Join my group for epic games!” The post will appear in a gui on other players screen. I want to save that post message and the person who posted it. Then I want to randomize from that save and display that on players screens. I do not have any system. This would work as any social media system. It will just get the string from the save for the message and the player name from the save and just use that.
I would use a Datastore but with 2 different Types of Keys:
The first one is to save The User’s Posts to their own key to their own Posts. The Key Value for the DataStore would look like “648942781_UserKey” for me as 648942781 is My UserID. The data that would be stores is all the posts I made etc. This allows you, to develop this into more, so you could add a search feature, Add Friends / Block People system etc.
For the Server, I recommend it has it’s Own Key called “AllServers_ServerKey” where you would store all the posts. What I would do here is add a Limit to this datastore so it can’t save more then 100,000 posts. (So you don’t run into datastore limits). You would remove the oldest post from this list once reaching this limit at add room. That way if all Servers Died and then people rejoined, you have a big list of the most recent posts. (Keep in mind that you will need great datastore management for making sure you follow those limits).
On top of the Server Datastore, I would connect a memory store. When A post is made, It is instantly added to the memory store for usage. This would allow really active people to make their posts instance instead of any delay. ’
To recap:
You have a Player datastore to Store Info about that One person
You have a Server Version of the Player datastore that stores the most recent X amount of posts. This can be used to fill up feed if nothing is around
You have a Memory store to use for actively new Posts. This wouldn’t need a limit as it should store less data. (You can always add one though), and allows you for quick access to current other people post.
This is how I would do it. There also is something Called MessagingService. This can work, I just didn’t bring it up as It can fail. And your limited to 125 characters 1kb (they changed it oops. Still only allows 1,000 characters. So if you wanted to make even longer posts anyways, my methods doesn’t change) per message, so it just makes sense to use a datastore to store posts for allowing more Max characters.