How do I return every single key within a datastore and it's value? I can't seem to do it myself.
{
Command = "pbans",
Arguments = {},
PermissionLevel = 5,
Code = function(Executor: Player)
print("pbans executed")
local Bans: DataStore = DataStoreService:GetDataStore(PermanentBansDataStore)
local ActiveBans: DataStoreKeyPages = Bans:ListKeysAsync("", 999999999999, "")
for key, value in pairs(ActiveBans:GetCurrentPage()) do
print("Key:", key, "Value:", value.value)
end
end
},
For now I'm just trying to get the list, this is to display in a GUI later on. "key" returns as an Instance and value (even without .value) returns as nil. Perhaps I'm completely doing it wrong, but I can't seem to do it even with help from the documentation.
** You are now Level 10! **