You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
list of all keys in datastore -
What is the issue? Include screenshots / videos if possible!
wont print any keys -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
warn("started")
local DataStoreService = game:GetService("DataStoreService")
local options = Instance.new("DataStoreOptions")
options.AllScopes = true
local buildingsStore = DataStoreService:GetDataStore("worldstring", options)
-- Search keys by prefix "house"
local listSuccess, pages = pcall(function()
return buildingsStore:ListKeysAsync("")
end)
print(listSuccess)
local a=0
if listSuccess then
while true do
a=a+1
print(a)
local items = pages:GetCurrentPage()
for _, v in ipairs(items) do
print(_)
--local value = buildingsStore:GetAsync(v.KeyName)
print("Key: ", v.KeyName)--, "Value: ", value)
end
if pages.IsFinished then
break
end
pages:AdvanceToNextPageAsync()
end
else
warn("something wrong")
end
warn("Finished")
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
it seems that it doesn`t get any pages
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.