Am making a lootbox system similar to Overwatch where you would open a box and you would get a random item, though there will be lots of cosmetics and the only way I know how to save data is values in a player such as a leaderstat, but making value in player for each cosmetic would be too much?
How would I make a more better way to save all these large amounts of cosmetics?
If you want to save large amounts of cosmetics in the Player object, you can just create a folder called āCosmeticsā in the Player and then add an IntValue for each unique cosmetic, with the value being the number of that item the player has.
It would Probably be more efficient to use DataStoreService when doing this, that way you can just grab their Data, and basically put it in the Game if they own it or not, It would probably be more efficient, but maybe a Memory Jump would happen?
Having Instances for each Cosmetic doesnt seem very convienient to have around, unless they are using it.
Iāve only ever really used it to save data like this:
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Val = Instance.new("IntValue")
Val.Name = "Val"
Val.Parent = leaderstats
Instead of values, I found out how to save tables, so instead of actually making a instance of a value its stored in a table, but am not sure if this is the bestest of bestest ways to save lots of data.