Datastore not saving changed NumberValues

Hello, I am creating a datastore and I have a problem where when saving the contents in the “PlayerStats” folder, it doesn’t save any new data.
I can’t seem to figure it out.

example: I start the game with “LV” 1 and change the NumverValue to 9, I leave the game and it prints that it saved it as 1 still.

local DataStoreService = game:GetService("DataStoreService")

local PlayerDataStore = DataStoreService:GetDataStore("PlayerData")

game.Players.PlayerAdded:Connect(function(player)
	local PlayerStatsKey = "PlayerStats-".. player.UserId
	local StatsTemplate = script.Stats
	local PlayerStatsFolder = Instance.new("Folder", player)
	PlayerStatsFolder.Name = "PlayerStats"
	
	local PlayerStatsSave = PlayerDataStore:GetAsync(PlayerStatsKey)
	
	for _, Template in pairs(StatsTemplate:GetChildren()) do
		local NewFolderStats = Instance.new(Template.ClassName, PlayerStatsFolder)
		NewFolderStats.Name = Template.Name
		NewFolderStats.Value = Template.Value
	end
	
	if PlayerStatsSave then
		for Value, Stat in pairs(PlayerStatsFolder:GetChildren()) do
			Stat.Value = PlayerStatsSave[Value]
			
			
			print("Loaded ".. player.Name .." ".. Stat.Name .." Value of "..Stat.Value)
		end
	else 
		
	end
	print("Loaded")
end)

game.Players.PlayerRemoving:Connect(function(player)
	local PlayerStatsKey = "PlayerStats-".. player.UserId
	local PlayerStatsFolder = player.PlayerStats
	
	print(PlayerStatsFolder.LV.Value)
	
	local PlayerStatsTable = {}
	
	for _, Stat in pairs(PlayerStatsFolder:GetChildren()) do
		table.insert(PlayerStatsTable, Stat.Value)
		
		
		print("Saved ".. player.Name .." ".. Stat.Name .." Value of "..Stat.Value)
	end
	
	PlayerDataStore:SetAsync(PlayerStatsKey, PlayerStatsTable)
	print("Saved")
end)

image_2022-09-18_014901801

Did you change the value on the server or client?

Make sure “Current: Server” is selected when changing the value.
image

I tried that, It says that it saved as the new value now, but loading it back up in a new session just loads it back at 1

When you went to the server side, Did you change the value from your specific player?
Example of where to change the value from:
image
I replicated your code without changing anything and it worked for me.

I was and it wasn’t working but it seems to work now, thank you.