I’m working on a datastore which stores the value inside player:
I haven’t write the SetAsync yet but I can’t even load it:
local data = {}
local DS_Folder_DataStore = dss:GetDataStore("DS_Folder_DataStore")
local emotesData = {}
local DS_Folder_EmotesData = dss:GetDataStore("DS_Folder_EmotesData")
for i,v in pairs (plr.DataStores:GetChildren()) do
if v then
table.insert(data, {key = plr.UserId,data_name = v.Name, value = v.Value})
end
end
for i,v in pairs (plr.emotesFolder:GetChildren()) do
if v then
table.insert(emotesData, {key = plr.UserId,data_name = v.Name, value = v.Value})
print("data_name="..v.Name.."Value="..v.Value.."key=".. emotesData[i].key)
end
end
for i = 1,#data do
if data[i].data_name ~= nil and data[i].value ~= nil then
plr.DataStores[data[i].data_name].Value = DS_Folder_DataStore:GetAsync(data[i].key)
end
end
for i = 1,#emotesData do
if emotesData[i].data_name ~= nil and emotesData[i].value ~= nil then
plr.emotesFolder[emotesData[i].data_name].Value = DS_Folder_EmotesData:GetAsync(emotesData[i].key)
end
end
For the First Datastore DS_Folder_DataStore
works fine, however for the emotes one, it errors:
I have no clue why it happens when they are basically the same thing, they just use a different table and DataStore but their scenario are same.
For the values that DS_Folder_DataStore stores, they are all IntValue
For the values that DS_Folder_emotesFolder store, they are all Strings:
Is the value type actually the root cause of the problem? I don’t see a direct relationship between the value type and the DataStore.