So, My game has lots of skins and I was thinking of adding trading, but that would mean I also need to add the ability to have multiples of each skin, I can make it work but I just don’t know how to save the amount. My saving system saves the skins in a table located in the player’s datastore. What would be the best way to save the amount? Would saving the amount in a table in each skin that is already in the skins table work?
Just need some idea on how to make it work.
You can save it as a table of dictionaries. Doing this from memory
Inventory = {}
Inventory [1] = {
Skin = “UPS Driver”,
Qty = 3}
Thanks, I was thinking something like this but wasn’t sure about it
I have a recommendation. Trading games usually end in griefing and duping, so don’t do stacking for the rarest trades. I added GUIDs/UUIDs to my inventory, kind of like a sanity check. That way you can scrub duplicates before saving.
Yeah, I might not even go through with it because the skins don’t come from roll crates. You just buy the ones you want and they have no rarity. So it kind of doesn’t make sense unless the player wants to trade seasonal skins. But I still wanted to know how to do it.
Also, that UUID system sounds awesome. Never thought about that. If I do end up adding it I’ll add some sort of id system like that.