Hey everyone, this is my first time using ordered data store. When I am trying to save the data, I get the Warn Data Couldn't be saved I don't know what im doing wrong?
local theStatsDataStore = game:GetService("DataStoreService"):GetOrderedDataStore("theStats") game.Players.PlayerAdded:Connect(function(player) local Exp = player:WaitForChild("theStats").Exp local Levels = player:WaitForChild("theStats").Levels local theData local success, theError = pcall(function() theData = theStatsDataStore:GetAsync(player.UserId) end) if success then if theData ~= nil then Exp.Value = theData[1] Levels.Value = theData[2] else print("No Data") end else warn("Data couldn't be loaded") end end) -- save the data game.Players.PlayerRemoving:Connect(function(player) local tableToSave = {} table.insert(tableToSave, player.theStats.Exp.Value) table.insert(tableToSave, player.theStats.Levels.Value) local success, theError = pcall(function() theStatsDataStore:SetAsync(player.UserId, tableToSave) end) if success then print("Data Succesfuly Saved!") else warn("Data couldn't be saved") end end)
Is your error like a warn that prints something like "Further requests will be dropped"?