Jump Handling in Custom Controls

Recently I’ve been dabbling a little with Custom Controls because the ones provided by ROBLOX are just incomprehensible at the least with my knowledge at hand so I’ve been looking around and I came across a presumably old tutorial where Jumping was handled inside a BindToRenderStep, I wanted to know if that way of doing jumping was fine or if there is a better way to handle it as a future reference I wanna mention that I intend to add Multi Jumping and a Cooldown for it anyways below is the code I wrote and I really do apologize if it’s disgusting to look at and it seems that I have to apologize for my English too.

local moveZ = 0
local moveX = 0

local function handleMovement1(actionName, inputState, inputObject)
	if inputState == Enum.UserInputState.Begin then
		moveZ = (inputObject.KeyCode == Enum.KeyCode.W) and 1 or -1
	else
		moveZ = 0
	end
	return Enum.ContextActionResult.Pass
end

local function handleMovement2(actionName, inputState, inputObject)
	if inputState == Enum.UserInputState.Begin then
		moveX = (inputObject.KeyCode == Enum.KeyCode.D) and 1 or -1
	else
		moveX = 0
	end
	return Enum.ContextActionResult.Pass
end

local function handleJumping(actionName, inputState, inputObject)
	hum.Jump = (inputState == Enum.UserInputState.Begin) and true
	return Enum.ContextActionResult.Pass
end

run:BindToRenderStep("movementStep", Enum.RenderPriority.Input.Value, function()
	local direction1 = currentCamera.CFrame.LookVector*moveZ
	local direction2 = currentCamera.CFrame.RightVector*moveX	
	hum:Move(direction1 + direction2, true)
end)
		
cas:BindActionAtPriority("movementAction1", handleMovement1, false, 2000, Enum.KeyCode.W, Enum.KeyCode.S)
cas:BindActionAtPriority("movementAction2", handleMovement2, false, 2000, Enum.KeyCode.A, Enum.KeyCode.D)
cas:BindActionAtPriority("jumpingAction", handleJumping, false, 2000, Enum.KeyCode.Space)

The tutorial mentioned above: Tutorial:Making a 2D Platformer | Roblox Wiki | Fandom