Need help with making my skin system work with my character system

Sorry if this is a stupid question, I’m aware that there are some similar posts already about this, but none of them are the exact answer I’m looking for. The problem here is I don’t know if it would be better in the long run to have a different list for each character’s unlocked skins in the game, or have them all stored in one big list. Especially if new characters get added if I update the game. I’m still a fairly newish scripter as well, and need help with deciding which one would be better to use.

UnlockedCharacters = {"1x1x1x1", "2x2", "Shedletsky", "BrightEyes"},
UnlockedSkins = {"1x1x1x1_Default", "2x2_Default", "Shedletsky_Default", "BrightEyes_Default", "1x1x1x1_Pink", "1x1x1x1_Manager"},
UnlockedCharacters = {"1x1x1x1", "2x2", "Shedletsky", "BrightEyes"},
CharacterSkins_1x1x1x1 = {"Default", "Pink", "Manager"},

I would prefer using the first option for if you plan on all storing the user’s skins in a datastore later, so you wouldn’t have to make a datastore of skins for each character.

You could also use the second option later (which I like because of how concise it is) when you sort out the user’s data, that you already got, into sections for each character.

Heya! This is definitely not a stupid question, so don’t worry.

I’d recommend using dictionaries to store your data. It’s a great way to map skins to each character.

For example:

local UnlockedSkins = {
    Shedletsky = {
        Default = true,
        SomeVariant = true,
    },

    ["1x1x1x1"] = { -- You have to use ["String"] syntax here because it starts with a number
        Default = true,
        Pink = true,
        Manager = true,
    },
}

Using separate lists is usually a classic sign that dictionaries might make things cleaner, since they let you tie related data together. I’d definitely recommend reading up on them :).

Beautiful! I didn’t even know this existed, and this appears to be exactly what I was looking for.
Thank you so much! :grinning_face_with_smiling_eyes: