I want to read all values of a data store and create a gui for them, but I’m having trouble reading the data store. Here’s the script:
local success, passed = pcall(function()
rankedStore:GetAsync()
end)
if success then
for i, name in pairs(passed) do
addGui:FireClient(plr,name)
print("ui request sent")
end
end
I don’t think it can read the data store because I didn’t put a key as the argument, but I want to put all keys into a table. How could I do this?
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local addGui = ReplicatedStorage.FireAddGUI
local DataStoreService = game:GetService("DataStoreService")
local rankedStore = DataStoreService:GetDataStore("RankedStore")
Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(11635716) >= 254 then
local success, passed = pcall(function()
rankedStore:GetAsync()
end)
if success then
for i, name in pairs(passed) do
addGui:FireClient(plr,name)
print("ui request sent")
end
end
end
end)
I want to get all keys and values of the data store, not just the key and value of the data store, not just the one of the player that joined. What I’m asking is is there a way to get all keys and values of the data store in table form?