In my game i am using DataStore2 to save data
I have implemented table saving for customization and quests, and everything works perfectly fine. Those wont affect performance much, because players customize their character only once, and quests store is updated rarely (only when getting a new one or completing it)
However i am also working on an inventory table datastore. It works without any issues for now, but i am curious if this will be too heavy for performance, because in certain situations inventory store may get updated every second for each player.
If this will be heavy on performance, how can i improve this?
My code chunks
local DataStore2 = require(ServerScriptService.DataStore2)
local defCust = {Gender = "Male", Face = "86487700", Hair = "0", Color = "248,248,248", Shirt = "http://www.roblox.com/asset/?id=5583364865", Pants = "http://www.roblox.com/asset/?id=1838299111"}
local defQuest = {Quest1 = 0, Quest2 = 0, Quest3 = 0, Quest4 = 0, Quest5 = 0, Quest6 = 0, Quest7 = 0}
local defInventory = {Pickaxe = 1, Golddust = 0}
DataStore2.Combine("DATA", "xp", "nextxp", "lvl", "souls", "gold",
"strength", "toughness", "agility", "wisdom",
"charcustom", "quest", "inventory",
"checkpoint"
) --, "maskid", "armorid", "weaponid", "organization", "checkpoint")
And this is an example of inventory store getting updated frequently
if hit.Name == "GoldMine" and state.Value == "Attacking" then
inventTable["Golddust"] += 1
inventStore:Set(inventTable)
end
Any ideas how can i improve this?