How would I save a lot of data efficiently

  1. What do you want to achieve?
    I want to create a DataStore which saves all of the user’s settings, which is a lot.

  2. What is the issue?
    I am really not sure how to do this without having to save each individual setting which would take a long time and would put a large amount of strain onto the DataStores.

  3. What solutions have you tried so far?
    I have searched the developer forum and I am still yet to find an answer.

I know that there are ways to do this but I’m not sure how. Maybe through a table? Please reply I you know how to do this.

Thank you for reading, ItsMeJakeZer.

2 Likes

What “Settings” are you talking about? Are these settings you created yourself?

If so, I see no reason not to do this with a table/dictionary. Create a table, {}, and then add each setting along with its value. i.e: Name = “ItsMeJakeZer”. You can then save this table to a datastore the way you normally would with SetAsync()

1 Like

How would I retreive each individual setting and then send them to the client?

Either use a remote to send relevant information to the client, or have a module in ReplicatedStorage which would contain the retrieved data for every player, just access data from there for the client.

 -- on player added
 local data = -- retrieve data
 Remote:FireClient(player, data)

 -- client
 local settings 
 Remote.OnClientEvent:Connect(function(data)
     settings = data
 end)

 print(settings.AimSensitivity)  -- etc.

Or use a module

-- module
return {}
-- on player added
local module = require(module)
module[player.Name] = data

-- from client
local Settings = require(ReplicatedStorage.Module)[LocalPlayer.Name]
1 Like