Game's experiencing strange Datastore glitches

My game Find the Fridges has been dealing with strange save data issues that are causing a lot of people to lose data. I would like some help on how to fix/improve it.

One of the ways players lose data is whenever they leave, their data doesn’t save and the else statement in the pcall for if it errors is ignored for whatever reason. I don’t know why but this issue has had a surge in occurrences and is happening a lot more now for some reason despite me not updating the Datastore and it is causing my game to get a lot more dislikes.

The other way is a lot more uncommon but it is when they join their data doesn’t load and they lose all of their progress.

I have tried looking into DataStore2 and Profile Service but they won’t work well with my game as I have over 103 different pieces of data to save and it would take forever to change everything to work with them. I am looking for a way to make data errors a lot more rarer without having to completely change a ton of code in the game.

local DataStoreService = game:GetService("DataStoreService")
local Players, DataStoreService = game:GetService("Players"), game:GetService("DataStoreService")
local myDataStore = DataStoreService:GetDataStore("myDataStore")
local RunService = game:GetService("RunService")

local function load(player: Player)
	local playerUserId = "Player_"..player.UserId
	local data = nil
	local success, errormessage = pcall(function()
		data = myDataStore:GetAsync(playerUserId)
	end)
	if success then

		player:WaitForChild("ValueFolder").Moneys.Value = data.Moneys	
		player:WaitForChild("leaderstats").Fridges.Value = data.Fridges
		player:WaitForChild("FridgeFolder").BasicFridge.Value = data.Basic
	
	else
		print("Save Error")
		warn(errormessage)


	end
end

local function save(player: Player)
	local playerUserId = "Player_"..player.UserId
	local data = {

		Moneys = player:WaitForChild("ValueFolder").Moneys.Value;
		Fridges = player:WaitForChild("leaderstats").Fridges.Value;
		Basic = player:WaitForChild("FridgeFolder").BasicFridge.Value;

	}


	local success, errormessage = pcall(function()
		myDataStore:SetAsync(playerUserId, data)

	end)

	if success then
		print("Save Success")
	else
		print("Save Error")
		warn(errormessage)
		myDataStore:SetAsync(playerUserId, data)
	end
end

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:wait()
	load(player)
	while true do
		wait(420)
		save(player)
	end
end)

game.Players.PlayerRemoving:Connect(function(player)
	save(player)
end)

game:BindToClose(function()
	for _, player in ipairs(Players:GetPlayers()) do
		coroutine.wrap(save)(player)
	end
end)




Im seeing some issues here, why are you assuming the player will all ready have their folders? :WaitForChild() can become infinite yeild warnings like laggy players who take to load.

You should instead be creating the folders inside of the datastore script like this

local ValueFolder = Instance.new("Folder", player)
ValueFolder.Name = "ValueFolder"

local Moneys = Instance.new("NumberValue", ValueFolder)
Moneys.Name = "Moneys"
--
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"

local Fridges = Instance.new("NumberValue", leaderstats)
Fridges.Name = "Fridges"
--
local FridgeFolder = Instance.new("Folder", player)
FridgeFolder.Name = "FridgeFolder"

local BasicFridge = Instance.new("StringValue", FridgeFolder) -- im assuming your BasicFridge is a string value
BasicFridge.Name = "BasicFridge"

This way you know those values will be there and wont be nil

With these folders and values created in the datastore script it self you can easily set your data when a player joins like this

local data = nil 	
local success, errormessage = pcall(function() 		 
    data = myDataStore:GetAsync(playerUserId) 	end) 	

if success then
    Moneys.Value = data.Moneys
    Fridges.Value = data.Fridges
    BasicFridge.Value = data.Basic	
else 		
    print("Save Error") 		
    warn(errormessage) 	
end

Where would I add this? At the start of the script or in the Player Added function?

Well since you have your load function replace the code with my example

local function load(player: Player)
    local ValueFolder = Instance.new("Folder", player)
    ValueFolder.Name = "ValueFolder"

    local Moneys = Instance.new("NumberValue", ValueFolder)
    Moneys.Name = "Moneys"
    --
    local leaderstats = Instance.new("Folder", player)
    leaderstats.Name = "leaderstats"

    local Fridges = Instance.new("NumberValue",  leaderstats)
    Fridges.Name = "Fridges"
    --
    local FridgeFolder = Instance.new("Folder", player)
    FridgeFolder.Name = "FridgeFolder"

    local BasicFridge = Instance.new("StringValue", FridgeFolder) -- im assuming your BasicFridge is a string value
    BasicFridge.Name = "BasicFridge"
    --
    --
    local playerUserId = "Player_"..player.UserId
    local data = nil 	 
    local success, errormessage = pcall(function() 		 
        data = myDataStore:GetAsync(playerUserId) 
    end) 	
    if success then 
        Moneys.Value = data.Moneys 
        Fridges.Value = data.Fridges 
        BasicFridge.Value = data.Basic	
    else 		
        print("Save Error") 		 
        warn(errormessage) 	 
    end
end