So, obviously, every game will have many values that they want to save. Coins, gems, levels, exp, items owned, stats, etc…
First of all, is it normal for me to be saving this much stuff or am I doing something wrong?
sessionData[player] = {
-- Currencies
["Coins"] = 0,
-- Player stats
["Health"] = 100, ["Energy"] = 100,
-- Multipliers
["Damage Multiplier"] = 1, ["Defence Multiplier"] = 1, ["Health Multiplier"] = 1, ["Energy Multiplier"] = 1,
["Coins Multiplier"] = 1, ["Speed Multiplier"] = 1, ["Jump Power Multiplier"] = 1,
-- The stats
["Strength"] = 0, ["Defence"] = 0, ["Speed"] = 0, ["Jump Power"] = 0
}
I’m just wondering because pretty much every tutorial on datastores out there only gives an example on one value. Which brings me on to my next question; how do you store a large amount of values? I’ve been storing them all in a modulescript, which has the sessionData
of each player. Due to this I’ve never figured out how to use UpdateAsync()
instead of SetAsync()
considering I have so many values.
As right now I’m just practising with DataStores, I’ve began to look into DataStore2 as many have told me how useful it is. However, once again, an example is only given with 1 value. It also has a specific datastore, "pointsDataStore"
. This too, brought more confusion to me. With many values would I have a specific datastore for each one? Because previously I stored all data in one datastore.
I only continued to use this method because I’ve never encountered data loss. (Haven’t had a popular game either though, peaking at just over 100 concurrent players.