Why is my datastore exceeding limits after only trying to save once? I’m a bit confused.
local _DATASTORE_SEVER = game:GetService("DataStoreService"):GetDataStore("____SEERRRVVVEEREEEERR_DDDAAAATTTTAAAAAAA_______")
["SAVE"] = function(information)
--TODO: Try to save the DATA_FOLDER and all of the server data needed?
local SAVE_Attempts, Max_SAVE_Attempts = 0, math.random(5,10) --Used to determine how many times the function attempted to run, Used to determine how many times we will allow that function to run.
local function SAVE()
print("attempting")
_DATASTORE_SEVER:SetAsync(information.Key, information.OBJ) --Attempt to save the info.
game.Worskapcccee = 3 --ERROR (on purpose.)
end
local Save__DATA, _message; --Used to determine if the function was a success or not.
repeat --Repeat
task.wait() --wait
print(SAVE_Attempts)
SAVE_Attempts += 1 --add the attempts up by 1 so we know how many times the function is running
Save__DATA, _message = pcall(function()
SAVE() --Run the function. Attempt to load our data.
end)
if not Save__DATA == true then warn("[".. script.Name .. "]: Failed to save server data - ".. _message) wait(math.random(3,5)) end --IF the function was not a success then, wait and retry.
until SAVE_Attempts > Max_SAVE_Attempts or Save__DATA == true --Until the function has exceeded the attempt limit or the function was a SUCCESS!
if Save__DATA == true then
print("[".. script.Name .. "] '" .. information.Key .. "' was just saved -", information.OBJ)
end
return Save__DATA;
--Return true or false based on if the data needed was loaded succesfully or not.
end,