So I want to implement datastore, in the server there will be 30 ppl max and it should update every second for each player, i used profile service but it broke? Can anyone suggest something simpler or better for my case?
I don’t really know which one to use. But you should never send that many requests to the datastore. Read more about datastores here: Data Stores | Documentation - Roblox Creator Hub
and
But why do you need to save the data so often?
There must be a better solution.
(The documentation also specifically warns you about this.)
Quote: “ Be careful to not send requests to data stores too often. Requests on a data store key are placed in a queue and, if the queue fills up, additional requests will be dropped.
A common mistake may be updating a player’s gold data every time they collect a gold piece. Instead, store the player’s gold in a variable and only update the data store occasionally, such as with a periodic auto-save and/or when the player leaves the game.”
Would recommend doing requests each minute, or better yet, when you actually need to save it (ie: upon something important changing, for example a player’s balance, you would save it, rather than every second)
Also, what type of data are you storing / reading?
If it’s just things like levels, xp or rank. Just save it once the player leaves and every five minutes or so
ProfileService shouldn’t break but if it somehow did, use Datastore2. Keep in mind that the implementation is different so read the post carefully to make sure you don’t miss crucial information.
This question don’t really make sense and I see no scripts …
The update every second to a datastore sounds like a disaster also.
Data stores have limits before it stops accepting your requests. For set and get its 60 + numPlayers × 10. Which means you should at most be saving for any player every 6 seconds if you are only using a single field so as to not go over the budget. But why save that often? You should think more event driven. The server will have all the data needed for saving so when does a save need to happen? Well, when a player leaves you’ll want to save before cleaning up their data. You could also save every few minutes so that a player won’t lose more than a couple minutes of progress if the save on exit fails. If you need to store when the player makes robux purchases it also makes sense to immediately save. Or if there was a massive thing that changed in their save such as beating a super hard boss (so long as this is infrequent).
Basically save when a player exits and when something important happens that you can’t lose. Otherwise just occasionally back up the data in the scale of minutes not seconds.