Save your data in a table with special indexes to help make your data clearer.
How To Do It
Hiw to store data in a table like fashion:
--Saving
local data = {}
data.gems = plr.leaderstats.Gems.Value
data.coins = plr.leaderstats.Coins.Value
--You can add a ton of these
Storage:SetAsync(plr.UserId, data)
--Loading
local data = Storage:GetAsync(plr.UserId)
if data then
plr.leaderstats.Gems.Value = data.gems
plr.leaderstats.Coins.Value = data.coins
end
If you have any more questions, feel free to ask them.
Disclaimer: You should use pcalls with your datastore requests, I did not include them this time to make it easier to understand
Do you have any further questions? If you do not, glad I could help.
To answer your original question: You could store data on multiple keys, but you may experience throttling (Roblox limits the number of requests you can do). It is easier to store data in a table, as datastores have a max character limit of 260,000 characters, which will rarely be reached.
I’m glad you found it helpful, but in the future if you wish to say that you appreciate something, use the button to like the post. Otherwise, you end up giving notifications to everyone here (if they have them on), on a year old topic. If you have additional information to provide, making a new topic is a better solution.
Again, I’m glad you found this topic useful, but please don’t bump posts that are a year old.