Hi, I’m trying to save a vector3 in a dictionary but datastores don’t support that so I am saving it as a dictionary in a dictionary. The problem is that any properties that have this are disappearing. I think it may be because datastores have a limit of 3 layers of dictionaries but idk.
local saveData = saveStore:Get( -----------------------------------Vector 3 is breaking it
{
["1"] = { -- Save ID
["-1"] = {["Class"] = "GameProperties", ["Name"] = "First World", ["Description"] = "Your first save!"}, -- Properties of save
["1"] = {["_Name"] = "Baseplate", ["_Class"] = "Part", ["Anchored"] = true, ["Position"] = {["_Type"] = "Vector3",["X"]=0,["Y"]=0,["Z"]=0}, ["Rotation"] = {["_Type"] = "Vector3",["X"]=0,["Y"]=0,["Z"]=0}, ["Size"] = {["_Type"] = "Vector3",["X"]=50,["Y"]=1,["Z"]=50}, ["_Parent"] = "0"},
["2"] = {["_Name"] = "Spawn", ["_Class"] = "SpawnLocation", ["Anchored"] = true, ["Position"] = {["_Type"] = "Vector3",["X"]=0,["Y"]=1,["Z"]=0}, ["Rotation"] = {["_Type"] = "Vector3",["X"]=0,["Y"]=0,["Z"]=0}, ["Size"] = {["_Type"] = "Vector3",["X"]=12,["Y"]=1,["Z"]=12}, ["_Parent"] = "0"},
},
}
)
local saveInstances = {
["-1"] = nil,
["0"] = Instance.new("Folder", workspace)
}
for id, properties in pairs(saveData[saveNumber]) do
if tonumber(id) > 0 then
saveInstances[id] = Instance.new(properties["_Class"])
saveInstances[id].Name = id
for property, value in pairs(properties) do
print(property)
print(properties)
if string.sub(property, 1, 1) ~= "_" then
saveInstances[id][property] = value
end
end
end
end
Is this a problem with my code or datastores, and how do I fix it?