Problem: I had an error that got rid of my datastore, which clears the data forever.
I’m not sure why it printed an error because I use a module that handles the datastores.
I also made sure that the module would work as intended, with no flaws.
Output:
Module:
function data.LoadData(Player, folder)
local dataStore = DataService:GetDataStore(folder.Name)
local data
local success, errorMessage = pcall(function()
data = dataStore:GetAsync(Player.UserId .. "_" .. folder.Name)
end)
if success and data and data ~= nil then
for i, v in pairs(data) do
local item = folder:FindFirstChild(i)
if item then
item.Value = v
end
end
else
print(errorMessage, data)
end
end