Hello my name is architect and i am trying to figure this out! people lose their data for some reason and i have not found out why hope you can help me here or leave a link to one that is solved.
Here is the recent script:
Yes i am using a module script!
Here is the output
1 Like
This means you’re attempting to save/get data too many times at once. Your system seems to repeat and you check if the invError
is nil. For GetAsync
, you could just do:
local success, result = pcall(function()
return DataStore:GetAsync(key) -- just return the data store entry instead of making a local variable for it, it'll return to the "result" variable.
-- if it fails, the "result" variable would be the output
end)
if success then
if result then -- checks if the data isn't nil
-- there's data to load, do stuff
else
-- no data/new player
end
else
-- failed to save
warn(result)
end
And for SetAsync
do:
local success, message = pcall(function()
DataStore:SetAsync(key, value)
end)
if not success then
-- failed to save
warn(message)
end
Attempting to repeat it again until it does anything will just cause the queue to fill and it’ll fail
1 Like
Thank you i understand what you are meaning about on the other hand i do not know where to put the script you just mentioned but thanks for solving it!