The DataStore limit is something like 20 + 5 * #players per minute.
I'm not sure if the 20 is correct, but the 5 is.
That means, you could more or less, for every player, save their data 5 times per minute.
Of course saving every 12s might be too quick, I prefer something like a whole minute.
DataStores also allow you to directly save/load tables, no need for JSON.
There are some limits on that, but nothing too bad.
You can use {Money=123,Title="Minion"} just fine.
This is some code I wrote that should work with your folder structure:
01 | local function save(player) |
04 | for k,v in pairs (folder:GetChildren()) do |
05 | data [ v.Name ] = v.Value |
08 | if pcall (DS.SetAsync,DS,player.userId,data) then |
09 | return print ( "Data saved for" ,player) |
12 | warn( "Couldn't save data for" ,player) |
15 | local function load (player) |
19 | local s,e = pcall (DS.GetAsync,DS,player.userId) |
20 | if s then suc,data = s,e break end |
23 | for k,v in pairs (data) do |
24 | local val = folder:FindFirstChild(k) |
25 | if val then val.Value = v end |
27 | return print ( "Data loaded for" ,player) |
31 | warn( "Couldn't load data for" ,player) |
35 | local Players = game:GetService( "Players" ) |
36 | Players.PlayerAdded:connect( function (plr) |
40 | Players.PlayerRemoving:connect( function (plr) |
46 | for k,v in pairs (Players:GetPlayers()) do |
47 | coroutine.wrap(save)(v) |