Datastore not working?

Datastore just isn’t working, I am lost

local DataStore = game:GetService("DataStoreService"):GetDataStore("StoreName")

game.Players.PlayerAdded:Connect(function(player)
	local key = "key-"..player.userId
	local folder = Instance.new("Folder", player)
	folder.Name = "leaderstats"
	
	local baseDamage = Instance.new("IntValue", folder)
	baseDamage.Name = "BaseDamage"
	
	local baseStrength = Instance.new("IntValue", folder)
	baseStrength.Name = "BaseStrength"
 
	local save = DataStore:GetAsync(key)
	
	if save then
		baseDamage.Value = save[1]
		baseStrength.Value = save[2]
	else
		local load = {baseDamage.Value, baseStrength.Value}
		DataStore:SetAsync(key,load)
	end
end)

game.Players.PlayerRemoving:Connect(function(player)
	local key = "key-"..player.userId
	local load = {player.leaderstats:FindFirstChild("BaseDamage").Value, player.leaderstats:FindFirstChild('BaseStrength').Value}
	--it stops here
	DataStore:SetAsync(key,load)
end)

Yes, we are lost too. What isn’t working? Have you checked the console for any potential exceptions? Have you tried at least debugging your code? These are all crucial information

All I know, is it DOESNT run this line:

DataStore:SetAsync(key,load)

Are you certain of that? Have you tried at least debugging your code? Why not start with some printing.

I did. I put a print right before and after that single line, and it runs the before print but not the after.

Why are you setting their data when they join the game

Very weird. It should be working. The script looks fine. 🤷
local folder = Instance.new(“Folder”, player)
** folder.Name = “leaderstats”**

The only thing I could think is wrong is the folder name check if the folder is just called folder, happens to me sometimes too.