Detect when a player jumps

How to Detect when a player jumps?

4 Likes

Check out Humanoid state type.

1 Like

https://developer.roblox.com/en-us/api-reference/property/Humanoid/Jump

You can check if the humanoid’s state is changed. then check if that value is “Jump.”

1 Like

um it only tells you if the player is currently jumping or not. But I need to make it so it detects when a player jumps. So say the player jumps and then a function will run. Actually i need to make a superjump power. It makes you can jump high. Everytime you jump when you use it it works once and after you had the high jump it will be gone. please help

1 Like

Maybe UserInputService.JumpRequest Is what you’re looking for?

1 Like

i think it is but will it fire if the player is currently in the air, or dead, etc. because i don’t want their superjump powers to be used when they tried to jump when they are dead ;-;

1 Like

You can simply check the state of the Player’s Humanoid, FloorMaterial and Humanoid Health for that.

um no not really i want a kind of “event” when the player jumps successfully

1 Like

I have found another way to do this (i guess), You can use Humanoid.Jumping, Then check if the Player is Jumping or not (Via the Parameter passed through the function) and then just check all the other stuff. (FloorMaterial, State, Health, etc)

1 Like
local Player = game.Players.LocalPlayer
local Humanoid = Player.Character:FindFirstChild("Humanoid")

Humanoid:GetPropertyChangedSignal("Jump"):Connect(function(changed)
    if changed and Humanoid.Jump == true then
        print(Player.Name.." is jumping!")
    end)
end

That should work!

8 Likes

Few ways to do this

Humanoid.Jumping:Connect(function(IsJumping) --Best way to do this
    if IsJumping then
    else
    end
end)

Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()--Works, but why?
    if Humanoid.Jump == true then
    else
    end
end)

UserInputService.JumpRequest:Connect(function()--If you want to do airjump and stuff this is the way
end)
28 Likes

Nice Works realllywell exceptt that the first works slower to connect but the other two work faster so yea?

2 Likes

Update i am back i realized some work better in locals and others work better is server but it also depend on the lag in both.