data = datastore:GetAsync(userId)
if data == nil or data == {} then
newkey(userId)
print("Added user "..userId.." to the index.")
loginfo("Added "..userId.." to KEY_INDEX at "..os.time())
--More stuff
else
for key, value in pairs(data) do
print(key, "=", value) --It doesn't print anything, so it must be an empty table.
end
datastore:SetAsync(userId, data)
print(userId.." logged on.") --This happens
loginfo(userId.." logged on at "..os.time())
end
I'm using Crazyman32's DataStore Editor to watch my data. I keep clearing it before I test. It's supposedly just an empty table. It looks like this. However, for whatever reason, it says that I logged on. That means that the table is not empty. What am I doing wrong here?
