Help creating an index system for my game

Hi, I am making a game where it rolls a certain rarity every time you roll and I would like to keep track of how many of each the player has rolled (attached photo for reference). My first thought was to use datastores to do this but I have 36 rarities and making a datastore for each one not only takes a very long time to load but also exceeds the datastore request limit and causes the game to break. I was wondering if there was a way to keep track of them all separately but using a different method?

As a side note I can identify which one has been rolled just currently have no way of saving that data and then showing it inside this GUI.

Screenshot 2025-04-30 121614

I might not be understanding your question right but… You can save tables into datastores.

You can do stuff like this;

rarityDataStore:SetAsync(Player.UserId, {
  common = 201,
  uncommon = 34,
  rare = 4
  ultraRare = 1
})

(Realistically you’d save this data in combination with all the other data that has to be stored for the player.)

Save your stats on the server and only update the data store on leave. LikeProfile store.

How would i then update this through another script though?

A datastore entry can be get, set and updated from any script running on the server side.

But a better and more realistic approach would be to load the data once from the datastore when the player joins, update that data during their session then when they leave save their data to the datastore again.

I understand that but the fact that it is inside a table in a script im not sure how i would update the table from another script and then also how i fetch that data? im not experienced with saving a table like that

In any server script you can do

local data = rarityDataStore:GetAsync(Player.UserId) -- Load Data
-- That returns the data table {common = 201, uncommon = 34, rare = 4, ultraRare = 1}
data.common += 1 -- Add 1 to common
-- Data is now  {common = 202, uncommon = 34, rare = 4, ultraRare = 1}
rarityDataStore:SetAsync(Player.UserId) -- Save Data

But this is not a realistic approach.
I recommend you to watch some youtube videos about datastores and maybe just about the entirety of scripting on roblox.

This post by @GEILER123456 is also really good for starters.