How to save large amounts of cosmetics

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?

1 Like

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.

1 Like

How would you save/load the ā€˜Cosmeticsā€™ in the folder? Iā€™m also trying to create a system like this.

Do you have any topics/resources you could redirect me to?

If you want to save them/load them, you can use DataStoreService.

1 Like

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.

How would I use DataStoreService to do this?

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
  Val.Value = 0

  Val.Value = data["Val"]

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.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.