Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a datastore that can host multiple values?

Hey guys, I recently asked a question about my data-store, but the solution they gave me didn't work with multiple values (or I didn't know how to set it up), but I'm asking now for a data-store that can host multiple values like Wood, Stone, Iron, Rope, Obsidian, etc.. Also if you could include how can I add more values to the data-store myself! That'd be nice. ALL HELP IS APPRECIATED!

1 comment

0

I looked on youtube and couldn't find anything helpful too, so I came here :D Apologies if you were one of the people that responded to my previous question, I just didn't understand how to set it up with multiple values

1 answer

You can simply store the values in a dictionairy table.

local data = {Wood = 1, Stone = 2, Iron = 3, Rope = 4, Obsidian = 5}
local dataStore = game:GetService("DataStoreService"):GetDataStore("Some Name")

dataStore:SetAsync("some key", data)

This discussion is preserved as it was. New answers, comments, and votes are closed.