I've only found this on one other topic and since nobody answered I thought I'd post my own troubles with this: I have one player, yes, only one player that get's this error, for some strange reason it's only that person everyone else's data loads perfectly fine, what I'm trying to get at is, what is this error? What causes it and is it preventable, I just have a simple datastore loading and saving and it seems neither works for this one person.
local DataStoreService = game:GetService('DataStoreService')
local Saves = DataStoreService:GetDataStore('Saves')
game.Players.PlayerAdded:connect(function(player)
wait() --Tested to see if it needed more time it doesn't.
local user = "User_" .. player.userId
local saves = Saves:GetAsync(user) --Throws error here again, just for this one player.
local efold = player:WaitForChild("Events")
delay(2.575, function()
wait()
if saves then
print("There is a save for: " ..player.Name)
efold:WaitForChild("HistoryUpdate"):Fire(saves, player)
else
print("There is NOT a save for: " ..player.Name.. " creating one...")
--Number of keys to save:
local tbl = {
false, -- 1
false, -- 2
false, -- 3
false, -- 4
false, -- 5
false, -- 6
false, -- 7
false, -- 8
false, -- 9
false, -- 10
false, -- 11
false, -- 12
false, -- 13
false, -- 14
false, -- 15
false, -- 16
false, -- 17
false, -- 18
false, -- 19
false, -- 20
false, -- 21
false, -- 22
false, -- 23
false, -- 24
false, -- 25
false, -- 26
false, -- 27
false, -- 28
false, -- 29
false, -- 30
false, -- 31
}
efold:WaitForChild("HistoryUpdate"):Fire(tbl, player) --Transfers data loaded to the script that needs it for the game to function and their data to load.
end
end)
end)
game.OnClose = function()
print("Doing last saves...")
wait(5)
end
Leave:
local DataStoreService = game:GetService('DataStoreService')
local Saves = DataStoreService:GetDataStore('Saves')
game.Players.PlayerRemoving:connect(function(player)
local user = "User_" .. player.userId
local saves = Characters:GetAsync(user) --I get the error message at this line in the output.
local efold = player.Events --Where the bindable function is stored
local savethis = efold.StatsSave:Invoke(player) --returns a table of trues/falses from another script
Saves:SetAsync(user, savethis)
end)
Would a few retries in my scripts help this cause?
