Hello! i’m trying to work with datastores right now and ive stumbled into a real massive issue, my datastore only seems to actually save things at random, sometimes it saves, sometimes it doesnt do anything, it seems that it’s mostly the second one, i littered my code with prints to be able to diagnose what worked and what didn’t, and i managed to find that it’s the SetAsync that’s sometimes not working
There’s a few issues with this, though, the SetAsync is on a pcall, which is supposed to print error messages if it works or not, and nothing prints, so it seems like the setasync just completely pauses the script, here are some pictures of the output
Here’s the output when it actually worked, the only time it properly worked, i know, creative prints, it’s whatever.
Here’s the output when it doesn’t work, aka, most of the time, you can see that it cuts off at the “WILL DO” print, which is right before the SetAsync
Here’s a code sample of the save function
local function saveData(player) -- The functions that saves data
local tableToSave = {}
tableToSave = tableFromFolder(player.CarData)
print(tableToSave)
print("WAITED")
local success, err = pcall(function()
print("WILL DO")
dataStore:SetAsync(player.UserId, tableToSave) -- Save the data with the player UserId, and the table we wanna save
print("DID")
end)
print("AAAHHH")
if success then
print("Data has been saved!")
else
print("Data hasn't been saved!")
warn(err)
end
end
any help??? please? i am super lost with this, i’m willing to provide more code samples on request, as i need as much help as i possibly can, many many thanks!!