Help With DataStore Saving

I am trying to save the dictionary below:

{
    ["props"] =  ▼  {
       ["1"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
       },
       ["2"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
       },
       ["3"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = 2, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 1
       }
    }
  }

to a data store but keep getting this error
“DataStoreService: CantStoreValue: Cannot store Dictionary in data store. Data stores can only accept valid UTF-8 characters. API: SetAsync, Data Store: Ships”

I can’t seem to figure out why the dictionary is invalid.

1 Like

Probably the same issue as in this post;
http://devforum.roblox.com/t/error-while-saving-data-saving-data-from-a-folder

My personal guess:
It’s probably in the “offset”. :123:

Try making offset into a table?

{
    ["props"] =  ▼  {
       ["1"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}
       },
       ["2"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = {2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}
       },
       ["3"] =  ▼  {
          ["id"] = "Test",
          ["offset"] = {2, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 1}
       }
    }
  }

I just copy pasted from the output window, it is a table in my code.

Added a JSON encode step to the dictionary before saving. Got rid of the error.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.