Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) not working

  1. What do you want to achieve?
    So i want to make the player jump using a script

  2. What is the issue?
    When using :ChangeState(Enum.HumanoidStateType.Jumping) the games shows that i am jumping but it reverts it immediately after and i don’t jump.

  3. What solutions have you tried so far?
    I have looked through so many posts and all say the same thing which is :ChangeState(Enum.HumanoidStateType.Jumping) the only problem is that it doesn’t. I have made sure that the charactor does exist and it still doesn’t work.

Note: i am using GitHub - EgoMoose/Rbx-Wallstick: A Lua module that allows you to stick to walls and objects in Roblox in the game as well i am saying this because i don’t know if this changes something but i have tried to turn it off and still the same problem

here is my script currently (Note the lines for getting the charactor and using the function is not written by me)

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
  local ch = plr.Character
  repeat wait() until ch ~= nil
  local hum = ch.Humanoid
  hum:ChangeState(Enum.HumanoidStateType.Jumping)
end)
1 Like

Can’t you just do this?

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	
	local ch = plr.Character
	
	if ch then -- If the character is here
		local hum = ch.Humanoid
		hum.Jump = true -- Make the player jump
	end
		
end)

I have also tried it. It give the exact same result

It works fine for me? Have you tried the script I sent?

Wait, do you want that the character keeps jumping?

Use this:

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
    plr.Character.Humanoid.Jump = true
end)

The script I used is exactly the same, but safer.

It is not really necessary to check if the character is there, it is always when the player loads and can click something, it might not load earlier when a screen gui is clicked.

If you want to make the character jump everytime, you can try something like:

while true do
     script.Parent.Humanoid.Jump = true
     wait(0.2)
     script.Parent.Humanoid.Jump = false
     wait(0.2)
end

it still doesn’t work. Here’s a video of it.
robloxapp-20210212-1420241.wmv (161.6 KB)
EDIT: So it does work just not with the wallstick thing i’ve added. I will be making a new post since this was just why it didn’t work mostly and now i know why so i’ll be making one to ask how to make the player jump with the wallstick in place