Multiple errors with DataStore2

I’m so tired these days, I keep getting errors on errors. Now new ones: this time, with DataStore2. I’ll explain what I’m doing (it’s for a Custom character creator btw):

  1. I create new string values when the player gets added
  2. Everytime the player selects something (for example hairs, or skin colors), the value is updated
  3. Each value is an “ID” to use with DSS2, so when the player joins the actual game, based on his IDs, the appearance of the character will be loaded.
    What’s the problem, you might ask? Well, when the values are updated, I get this error:
    PLUS, when the player leaves, the data doesn’t save giving me this error:

These are the functions that the error reminds to:
Line 191
Line 496
And line 30, the one from my script (I won’t send a screenshot since there’s 3 lines here


(Skin is the StringValue of the skin color, when it changes the data is simply :Set to the new value. Or at least, it should.
I’m pretty new to DSS2, I’ve been messing around with it for a couple of days, but I can’t get it to work here. Any help is appreciated, as always.

What is your current code?

I managed to solve it by myself. It was just a bug or something, I don’t know. The problem was that the FIRST element in the DataStore2.Combine code, was being saved as a table instead of a value for some reason. So I made a random “glitchedTable” as first element, and put everything after that. This is how it would look like:
DataStore2.Combine(“glitchedTable”, “hairs”, “skin”…)
The “glitchedTable” would save as a table, giving me the error and screwing up every other value. That’s it. Made me waste half a hour to understand what was the problem but whatever, I solved it.

(btw, my code simply was dataHairs:Get() , and not dataHairs:GetTable() as the error wrongly says)