Detecting player jumping on ladder

Hi Everyone!

I am making system where player jumps-nonstop but the problem is i dont want
that system make them jump on ladder

On my script when player touches on ladder it jumps sometimes i want that it be perfect

Heres the code

local char = script.Parent

local humanoid = char:FindFirstChild("Humanoid")

local deb = false

local run = game:GetService("RunService")

run.Stepped:Connect(function()

if humanoid:GetState() ~= Enum.HumanoidStateType.Landed then

humanoid.Jump = true

elseif humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then

humanoid.Jump = false

elseif humanoid:GetState() ~= Enum.HumanoidStateType.Jumping then

humanoid.Jump = false

end

humanoid.Jump = false

end)

Script is in StarterCharacterScripts

You might want to try using Humanoid:SetStateEnabled(), which entirely disable or enable jump for player.

Let me do a simple manipulation on your script:

local char = script.Parent
local humanoid = char:FindFirstChild("Humanoid")
local run = game:GetService("RunService")

run.Stepped:Connect(function()
    if humanoid:GetState() == Enum.HumanoidStateType.Climbing then
        humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    else
         humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
    end
end)
2 Likes

It actually doing the same thing notihng changed It again climbing on ladder sometimes not always if you ever played game called Tower of Hell there is mutator bunny hop which makes people jump non-stop but when people is climbing it stops

But the script that we did makes player jump when it touches on ladder

Thanks