Hey everyone! I am currently working on a game where I have to create leaderboards for players" accuracy on a song. The only issue is that there are over 300 songs. Is there a quick was to make a datastore for every single song or do I manually have to write DataStoreService:GetDataStore(songName) for every song? Thank you
There is no need to create 300 DataStores, you can use a single DataStore and use a table/dictionary to store info.
He wants 300 individual leaderboards for 300 songs, not 300 individual songs inside 1 DataStore.
Locate the section titled “Scopes”.
You should use scopes to achieve this, have each song take on its own scope in a single DataStore.
exactly because there will be multiple players recorded with their score in that data store
local data = {"song1" = 213213, "song2" = 4324324}
datastore:SetAsync(player.UserId, data)
A second alternative would be to have a table which contains keys/fields which match the names of songs & their associated values would represent the scores the user achieved for those songs. I think this will work best out of the 2 options.
I prefer the first alternative because I am using an ordered data store