My DataStore is not functioning, it always returns 0 FIXED

I have had some trouble with my DataStore as mentioned in a previous post, this time the error is different. There are no error messages however whenever I try to save data when a person leaves, in this case; JumpPower it always returns as 0. Any help is appreciated

local DataStoreService = game:GetService("DataStoreService")
local MyDataStore1 = DataStoreService:GetDataStore("myDataStore")

game:WaitForChild("Players").PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local JumpPower = Instance.new("IntValue")
	JumpPower.Parent = leaderstats
	JumpPower.Name = "JumpPower"
	JumpPower.Value = 0
	
	local playerUsedId = player.UserId
	
	--Load Data
	
	local data
	local success, errormessage = pcall(function()
		data = MyDataStore1:GetAsync(playerUsedId)
	end)
	
	if success then
		JumpPower.Value = data
	end
	
end)


game.Players.PlayerRemoving:Connect(function(player)
	local playerUsedId = "Player"..player.UserId
	
	local data = player.leaderstats.JumpPower.Value
		
	local success, errormessage = pcall(function()
		MyDataStore1:SetAsync(playerUsedId, data)
	end)
	
	if success then
		print("Data Successfully Saved")
		print(data)
	else
		print("There was an error")
		warn(errormessage)
	end
end)

I don’t get it. The value is always set to 0 in the script.
Do you change it outside of the script?

I think it’s because you are using different keys for getting a data and saving a data.
Consider making the keys the same value.

[[PlayerAdded]]
local playerUsedId = player.UserId

local data
local success, errormessage = pcall(function()
	data = MyDataStore1:GetAsync(playerUsedId) -- Used key: player.UserId
end)
[[PlayerRemoving]]
local playerUsedId = "Player"..player.UserId

local success, errormessage = pcall(function()
	MyDataStore1:SetAsync(playerUsedId, data) -- Used key: "Player"..player.UserId
end)