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

How do I loop through a data store?

Asked by 10 years ago

I want to loop through the keys, how would this be done?

I did this:

for i,v in pairs(crews:GetChildren()) do if v[4][plr.Name] then ranks = v[4] cap = ranks[1] createrank(1,cap) function rest(...) stuff = {} for i,v in pairs(...) do table.insert(stuff,v) end return unpack(stuff) end others = rest{ranks} if others[2] then for i = 2,#others do createrank(others[i][2],others[i]) end end end end

EDIT:

THis is how it saves:

local store = game:GetService("DataStoreService"):GetDataStore("Crews")

store:SetAsync("KKKK",{6534523,"Player2",1,{"Player2" == {"Player2", 1}},last = 1})

Answer this question