I added character customization to my game, and when a player leaves I want the game to save what they looked like. So what I tried doing first was making a table and serializing what they look like. So the first value of the table would be the name of their skin color, then the next would be their shirt ID, and same with pants and face. I started out with the skin color and instead of putting it in the table I wanted to see if it would work with just a regular variable first. I got an error when trying to save the value to data store.
“104: Cannot store int in data store. Data stores can only accept valid UTF-8 characters.”
Here is the code
local SkinColor = char.Head.BrickColor SkinColorData:SetAsync(player.UserId.."-SkinColor", SkinColor)