Saving player walk speed and jump power stats with datastore

Yeah I don’t really know what else to do, and just for context, here is the current script I have.

local DSS = game:GetService("DataStoreService"):GetDataStore("SpeedDSS")

game.Players.PlayerAdded:Connect(function(plr)

	local leaderstats = Instance.new("Folder", plr)
	leaderstats.Name = "SpeedStore" --[[ Change this to the name of your leaderboard name it leaderboard if you want to see the leaderboard, if not set it to a random name, that’s you can remember --]]

	local speed = Instance.new("IntValue", leaderstats)
	speed.Name = "speed"

	local jump = Instance.new("IntValue", leaderstats)
	jump.Name = "jump"

	local level = Instance.new("IntValue", leaderstats)
	level.Name = "idk"

	local data = DSS:GetAsync(plr.UserId)

	if data then
		-- We know the player has data

		speed.Value = data.speed

		jump.Value = data.jump

		level.Value = data.level

	else

		print("First Time Playing")

		-- Set to default values
		level.Value = 0

	end

	plr.CharacterAdded:Connect(function(char)

		task.spawn(function()

			while wait() do

				-- Setting walkspeed and jumpower

				speed.Value = char:WaitForChild("Humanoid").WalkSpeed
				jump.Value = char:WaitForChild("Humanoid").WalkSpeed

			end

		end)

	end)

end)

game.Players.PlayerRemoving:Connect(function(plr)

	local TableGettingSaved = {}

	for i, v in pairs(plr:WaitForChild("SpeedStore"):GetChildren()) do

		table.insert(TableGettingSaved, {Name = v.Name, Value = v.Value})

	end

	DSS:SetAsync(plr.UserId, TableGettingSaved)

end) 

I honestly kind of just give up, unless someone can send a model of this working then there is no way I am going to get this to work.