Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Fako16 13
6 years ago

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!

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 Fako16 13 — 6y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

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)
Ad

Answer this question