Cannot Store Dictionary in data store. Data stores can only accept valid UTF-8 characters

Right now im trying to save most of a parts property but I am getting an error with Cannot store Dictionary in data store, why? I don’t know maybe I’m missing something in the table that makes it non saveable. Ive tried on other posts to see if i were missing something but I should be able to store values, strings, numbers right?

{
                    ["Index"] =  ▼  {
                       [1] =  ▼  {
                          ["Anchored"] = false,
                          ["Archivable"] = true,
                          ["BrickColor"] = "Medium stone grey",
                          ["CanCollide"] = true,
                          ["CanTouch"] = true,
                          ["CastShadow"] = true,
                          ["CollisionGroupId"] = 0,
                          ["Color"] = 0.639216, 0.635294, 0.647059,
                          ["Locked"] = false,
                          ["Massless"] = false,
                          ["Material"] = "Enum.Material.Plastic",
                          ["Name"] = "Part",
                          ["Orientation"] = 0, 0, 0,
                          ["Position"] = -0.999022484, 1.49560118, -1.00097752,
                          ["Reflectance"] = 0,
                          ["RootPriority"] = 0,
                          ["Shape"] = "Enum.PartType.Block",
                          ["Size"] = 4, 1, 2,
                          ["Transparency"] = 0,
                          ["Type"] = "Part"
                       }
                    },
                    ["Name"] = "TestSave"
                 }
1 Like

I don’t think you can store arrays in one key:

 ["Color"] = 0.639216, 0.635294, 0.647059,

You might have to do this:

 ["Color"] = {0.639216, 0.635294, 0.647059}

Okay thanks I’ll try it out in a moment.

You need to bracket-up the variables that utilize more than 1 space

[“Size”] = 4, 1, 2, incorrect

[“Size”] = {4, 1, 2}, correct

If you still get an error after doing these changes let us know,

Looks like im still getting an error
(output)

{
                    ["Index"] =  ▼  {
                       [1] =  ▼  {
                          ["Anchored"] = false,
                          ["Archivable"] = true,
                          ["BrickColor"] = "Medium stone grey",
                          ["CanCollide"] = true,
                          ["CanTouch"] = true,
                          ["CastShadow"] = true,
                          ["CollisionGroupId"] = 0,
                          ["Color"] =  ▼  {
                             [1] = 0.639216, 0.635294, 0.647059
                          },
                          ["Locked"] = false,
                          ["Massless"] = false,
                          ["Material"] = "Enum.Material.Plastic",
                          ["Name"] = "Part",
                          ["Orientation"] =  ▼  {
                             [1] = 0, 0, 0
                          },
                          ["Position"] =  ▼  {
                             [1] = -0.999022484, 1.49560118, -1.00097752
                          },
                          ["Reflectance"] = 0,
                          ["RootPriority"] = 0,
                          ["Shape"] = "Enum.PartType.Block",
                          ["Size"] =  ▼  {
                             [1] = 4, 1, 2
                          },
                          ["Transparency"] = 0,
                          ["Type"] = "Part"
                       }
                    },
                    ["Name"] = "TestSave"
                 }

dont set values in a table like this:
image
when you set values it’ll auto populate the first value into pos 1:
image

You can’t store userdata’s in data stores. You may want to look into serialization (e.g converting a color3 into a table of R, G, and B).

I Finally got them converted right thank you, and it saves and loads the table.