I've been getting some visits at my place, and I was curious about who exactly was visiting. So, I made a datastore for storing visitors' basic info in keys named by their user ID's. Then I realized that I won't know how to actually look at all the keys I have in that store. Is there any way that I can list all the keys in the store?
datastore = game:GetService("DataStoreService"):GetDataStore("Visitors")
http = game:GetService("HttpService")
function onPlayerAdded(player)
local data = {}
data.Name = player.Name
data.MembershipType = player.MembershipType
data.AccountAge = player.AccountAge
datastore:SetAsync(player.userId, http:JSONEncode(data))
end
game.Players.PlayerAdded:connect(onPlayerAdded)

3 comments
That's a good question
@adark, There is a way.
@funyun, There are only 2 keys in a global datastore, that would be "key" & "value". The key would be the scope or the username then the "value" would be a boolean or number and etc.. But, it takes a special datastore (Most people dont know about) to access the "key" & "value".