How to stores some specific Datas like quests that are completed ,keybinds,Tokens,ect… i believe that not only datastore service is required here
Additionally are there any tutorials about how to store some datas like this
The way you can store different datatypes is by serializing them.
The only thing you have to do is convert the datatype to a string or table so that it can be converted into JSON which can then be stored in datastores.
This might help
Data-stores can only store UTF-8 encodable data. In other words, anything that can be directly converted to raw text. As you know, some data cannot. This is where serialization comes into play. Serialization is the process of reducing complex abstract data structures into the least amount of primitive information required to reconstruct (deserialize) the data structure.
For example, say you wanted to save a Vector3. The foremost information that makes up a Vector3
is its XYZ axes. These values are numbers, and numbers are UTF-8 encodable. With these numbers, we can also rebuild the same Vector3
. Start by saving the numbers a CSV (comma-separated values) string:
local function serializeVector3CSV(vector3: Vector3): string
local axis = {
vector3.X,
vector3.Y,
vector3.Z,
}
return table.concat(axis, ", ")
end
As for deserialization:
local function deserializeVector3CSV(csv: string): Vector3
local axis = string.split(csv, ",")
return Vector3.new(table.unpack(axis))
end
Together, like a codec, these functions make up a SerDes. You will need to develop a SerDes for each abstract data structure you wish to save. Fortunately for you, however, some dedicated developers have strung up a technology called Squash, which is a compression library for Luau. It contains a myriad of SerDes functions
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.