I am trying to set up a datastore system to save a large amount of boolean values based on what the player has unlocked. Just now, the script refuses to save any amount of data. It appears to load perfectly fine, but absolutely nothing is properly saving.
The script has been working fine for months and all of the sudden does not, to my knowledge nothing significant has changed in how it works.
game.Players.PlayerAdded:connect(function(player)
local ds = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")
player:WaitForChild("masterstats")
wait(1)
local s = player:FindFirstChild("masterstats"):GetChildren()
for i = 1, #s do
stats[i].Value = ds:GetAsync(stats[i].Name)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local ds = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")
local ss = player:FindFirstChild("masterstats"):GetChildren()
for i = 1, #ss do
ds:SetAsync(ss[i].Name, ss[i].Value)
end
end)