How Would I Check If Humanoids State is Jumping In This Script?

So i’m trying to make a downslam move, and when punchcombo reaches maxCombo, it should check if humanoid state is Jumping, then do a certain thing.
image
The reason im returning in here so it doesn’t play a normal punching animation, it should play a different animation.

1 Like

I think it’d be:

if humanoid:GetState == Enum.HumanoidStateType.Jumping then

However, iirc jumping as a StateType doesn’t last very long. If it doesn’t, use Enum.HumanoidStateType.Falling.

Hope this helps :grinning:

From what you’re looking to do you may want to go with .Freefall

i just did

local inAir = human:GetState() == Enum.HumanoidStateType.Freefall

and then check if its in air while 5th m1 and it worked

An old test script …

local rs = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

task.wait(2)
local humanoid = char:WaitForChild("Humanoid")

humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
	rs.Stepped:Wait()
	print(humanoid.FloorMaterial)	
end)

humanoid.StateChanged:Connect(function(oldState, newState)
	rs.Stepped:Wait()
	print(newState)
end)

This is what a jump comes out as …
Freefall and Air together are for sure falling.
The rs.Stepped:Wait() is also needed to get good read.

Enum.HumanoidStateType.Jumping
Enum.HumanoidStateType.Freefall
Enum.Material.Air
Enum.HumanoidStateType.Landed
Enum.Material.Sand
Enum.HumanoidStateType.Running

if humanoid.Jump then
    print("Humanoid is jumping")
else
    print("Humanoid isn't jumping")
end