Other ways of saving or efficient way of saving multiple item, with different information such as health, attack, etc. My current idea of saving is using the name of the attribute that I want to save:
data = {
{
Item = "...",
Replica = 0,
Attack = 1,
Health = 1
},
{
Item = "...",
Replica = 1, --If the item already exist; for the gui.
Attack = 10,
Health = 10
},
{
Item = "idk",
Replica = 0,
Attack = 10,
Health = 10
}
}
It’s a player data, I can’t use the exact name of the item as a key for the table, because the player will have the same item but different stats, some may have more stat attributes(not the value of the attribute) some may have less.
In this case, your format is suitable. You can avoid storing some useless properties for each of your items by defining default values for these properties, that will exist only at runtime and won’t be saved, but this is good enough already.