How to detect if player is moving and is simultaneously jumping?

If you are jumping, you can’t really check at the same time if you are running with GetState(), the method I used to check if the player is moving and jumping, which didn’t work. Any solutions to this problem that I can use?

Try this:

local localPlayer = game.Players.LocalPlayer
local char = localPlayer.Character

for m = 1,1,1 do
    if char.PrimaryPart.CFrame = char.PrimaryPart.CFrame + Vector3.new(m,m,m) then
        —code here

This didn’t work, I tried to make a print statement and it didn’t print out anything.

use if pressing w and space:

local UIS = game:GetService("UserInputService")
function isjumping()
    if UIS:IsKeyDown(Enum.KeyCode.Space) and UIS:IsKeyDown(Enum.KeyCode.W) then
        return true
    else
        return false
    end
end

If you want it detect when him is jumping and walking every time and do something do a loop (while true do) and if you dont want stop code do a task (task.spawn)

local Game = game
local Players = Game:GetService("Players")
if not Players.LocalPlayer then Players:GetPropertyChangedSignal("LocalPlayer"):Wait() end
local Player = Players.LocalPlayer
if not Player.Character then Player:GetPropertyChangedSignal("Character"):Wait() end
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")

local function OnHumanoidJumping(Active)
	if not Active then return end
	if Humanoid.MoveDirection.Magnitude == 0 then return end
	print("Moving and jumping!")
end

Humanoid.Jumping:Connect(OnHumanoidJumping)