DataStore Error combines

Im having an problem which is combining there data.

local DS2 = require(game.ServerScriptService.Settings:WaitForChild("MainModule"))
DS2.Combine("MasterKey", "leaderlevs")

game.Players.PlayerAdded:Connect(function(plr)
	local dataLevel = DS2("leaderlevs", plr)


	local folder = Instance.new("Folder", plr)
	folder.Name = "leaderlevs"

	local Levels = Instance.new("IntValue", folder)
	Levels.Name = "Levels"
	
	local Exp = Instance.new("IntValue", folder)
	Exp.Name = "Exp"

	if dataLevel:Get() ~= nil then
		Levels.Value = dataLevel:Get()
		Exp.Value = dataLevel:Get()
		
	else
		Levels.Value = 0
		Exp.Value = 0
	end
	

	

	Levels.Changed:Connect(function()
		dataLevel:Set(Levels.Value)
		
	Exp.Changed:Connect(function()
			dataLevel:Set(Exp.Value)
			end)

		end)
	end)

Is there an error in the output?

Actually, you didn’t set the DS2 properly. I suggest you to take a look at youtube, i found one or 2 videos. As i am using DataStore2 too, i learn’t on youtube and it works pretty fine now

try this:

game.Players.PlayerAdded:Connect(function(plr)
	local dataLevel = DS2("leaderlevs", plr)

	local folder = Instance.new("Folder", plr)
	folder.Name = "leaderlevs"

	local Levels = Instance.new("IntValue", folder)
	Levels.Name = "Levels"
	
	local Exp = Instance.new("IntValue", folder)
	Exp.Name = "Exp"
	
	local tableToSave = dataLevel:Get({exp = 0, lvl = 0}) -- dataLevel:Get([DefaultValue])

    -- If :Get() found any value, set that value to my exp, else, get the value from defaultTable
	Levels.Value = tableToSave.lvl
	Exp.Value = tableToSave.exp
	
    -- Whenever my exp changes, set the value in the table to my exp, and save the table
	Levels.Changed:Connect(function()
		tableToSave.lvl = Levels.Value
		dataLevel:Set(tableToSave)
	end)
	Exp.Changed:Connect(function()
		tableToSave.exp = Levels.Value
		dataLevel:Set(tableToSave)
	end)
end)

Also read the data store documentation: API - DataStore2

local DS2 = require(ds2_location)
DS2.Combine("MasterKey", "leaderlevs", "exp") -- exp

game.Players.PlayerAdded:Connect(function(plr)
	local dataLevel = DS2("leaderlevs", plr)
	local dataExp = DS2('exp', plr)
	local folder = Instance.new("Folder", plr)
	folder.Name = "leaderstats" -- mmm
	local Levels = Instance.new("IntValue", folder)
	Levels.Name = "Levels"
	Levels.Value = dataLevel:Get(0) -- 0 is the default value
	local Exp = Instance.new("IntValue", folder)
	Exp.Name = "Exp"
	Exp.Value = dataExp:Get(0)
	Levels:GetPropertyChangedSignal('Value'):Connect(function()
		dataLevel:Set(Levels.Value)
	end)
	Exp:GetPropertyChangedSignal('Value'):Connect(function()
		dataExp:Set(Exp.Value)
	end)
end)

game.Players.PlayerRemoving:Connect(function(p)
	local dataLevel = DS2("leaderlevs", plr)
	local dataExp = DS2("exp", plr)
	dataLevel:Save()
	dataExp:Save()
end)

Levels:GetPropertyChangedSignal(‘Value’) == Levels.Changed