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

How to load every saved datastore data into a table?

Hello. So currently, I am working on datastores, but need to load every saved data into a table. By every, I mean every player's saved data, not just mine.

How can I replicate this? I have tried:

local datastore = game:GetService("DataStoreService")
local valueData = datastore:GetDataStore("fhalcinx8wefy2p91243532")

-- blah blah blah stuff here that adds stuff to datastore that I don't want to show

local testing = valueData:GetAsync()
for _,v in pairs(testing) do
	print(v)
end

No results, no error.

Any help is appreciated.

1 answer

You forgot to include a key. A key is the thing that the data is stored under.


local datastore = game:GetService("DataStoreService")
local valueData = datastore:GetDataStore("fhalcinx8wefy2p91243532")

-- blah blah blah stuff here that adds stuff to datastore that I don't want to show

local Key = "Your key here"

local testing = valueData:GetAsync(key)
for _,v in pairs(testing) do
    print(v)
end

1 comment

0

i don't want one kid's value, i want everyone's saved data

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