Problem saving values!

Does anyone know why these script dont work togerther or on its own the multiplier value saves the same value as the “Number” leadersatts. I’ve tried to make it an easy way to add values wich will save. Can someone please help me?

player values script:

local DataStoreService = game:GetService("DataStoreService")
local playerData = DataStoreService:GetDataStore("PlayerData")

local playerValuesTable = {"Multiplier"}

local function onPlayerJoin(player)
	
	local playerValues = Instance.new("Folder")
	playerValues.Name = "PlayerValues"
	playerValues.Parent = player
	
	local playerUserId = "Player_" .. player.UserId
	local data = playerData:GetAsync(playerUserId)
	
	for index, value in pairs(playerValuesTable) do
		local newValue = Instance.new("IntValue")
		newValue.Name = value
		newValue.Parent = playerValues
		
		if data then
			newValue.Value = data
		else
			newValue.Value = 0
		end
	end
end



local function onPlayerExit(player)
	local success, err = pcall(function()
		local playerUserId = "Player_" .. player.UserId
		for i, v in pairs(player.PLayerValues:GetChildren()) do
			playerData:SetAsync(playerUserId, v.Value)
		end
	end)

	if not success then
		warn('Could not save data!')
	end
end


game.Players.PlayerAdded:Connect(onPlayerJoin)
game.Players.PlayerRemoving:Connect(onPlayerExit)

Normal leaderstats script:

local DataStoreService = game:GetService("DataStoreService")
local playerData = DataStoreService:GetDataStore("PlayerData")

local function onPlayerJoin(player)

	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local number = Instance.new("IntValue")
	number.Name = "Number"
	number.Parent = leaderstats

	local playerUserId = "Player_" .. player.UserId
	local data = playerData:GetAsync(playerUserId)

	if data then
		number.Value = data
	else
		number.Value = 0
	end
end

local function onPlayerExit(player)
	local success, err = pcall(function()
		local playerUserId = "Player_" .. player.UserId
		playerData:SetAsync(playerUserId, player.leaderstats.Number.Value)
	end)

	if not success then
		warn('Could not save data!')
	end
end



game.Players.PlayerAdded:Connect(onPlayerJoin)
game.Players.PlayerRemoving:Connect(onPlayerExit)

Correct me if I’m wrong but, the problem is that its not saving correctly?

When you save the values, You keep overwriting the Data with a Value, Use a table to save them all together.