Changing the Humanoid State to Jumping Not Working

I’m trying to make a bounce pad, but I’m currently having an issue. The issue is that for some reason the player doesn’t jump up when they step on the pad (or they just slightly do it and then fall downwards) and this causes issues because the way the jump pad works is that it first makes a linear velocity that will propel the player upwards when they jump all of the way up to about 72 studs.

So if the player doesn’t jump, then the linear velocity will be useless due to the fact that it won’t propel the player upwards after the player jumps.

Doing workspace.StarJ3M.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) works after I copied the linear velocity and put it into the primary part of the player, but for some reason it just doesn’t work whenever I try using it on the jump pad.

Here’s my code.

function module:jumpPad(player)
	local linearVelocity = Instance.new("LinearVelocity")
	linearVelocity.Parent = player.Character.PrimaryPart
	linearVelocity.Attachment0 = Instance.new("Attachment")
	linearVelocity.Attachment0.Parent = player.Character.PrimaryPart
	linearVelocity.Attachment1 = Instance.new("Attachment")
	linearVelocity.Attachment1.Parent = player.Character.PrimaryPart
	
	linearVelocity.MaxForce = 2200
	linearVelocity.VectorVelocity = Vector3.new(0, 1000, 0)
	
	linearVelocity.Enabled = true
	
	player.Character:FindFirstChildOfClass("Humanoid"):ChangeState(Enum.HumanoidStateType.Jumping)
	
	local particle = game:GetService("ReplicatedStorage").GameAssets:FindFirstChild("Particles").BouncePad:Clone()
	particle.Parent = player.Character.PrimaryPart
	
	task.wait(5)
	
	linearVelocity.Enabled = false
	
	particle.Enabled = false
	
	task.delay(5, game.Destroy, particle)
end
2 Likes

You cannot ChangeState on the non-network owner. You must either do so using the network owner or enable Humanoid.Jump

1 Like

I’m not really sure how network ownerships work, but are you saying that I can’t change the humanoid state on a module script or server script?

Just from the server or other clients.

It needs to be the same client. Or, if on the server, you can enable Humanoid.Jump to make them jump.

1 Like

So then can I do this in a local script if I put it inside of the character model?

1 Like

Yeah, of course you can. It should work.

1 Like

I’ve tried doing that but the only problem is that when a player jumps on top of the pad then they will not be affected.

1 Like

But why? Doesn’t it happen when they’ve already stepped on the pad?

1 Like

I’m assuming its because of the way that Humanoid States work, the player must still be in the jump state and so by the time they land on the pad, nothing changes. So that’s why I’ve been trying to use ChangeState()

1 Like

After the state changes to Landed, they immediately go back to Running.

It shouldn’t cause any problems, but I don’t think that it replicates.

1 Like

According to the data I’ve collected for some reason it just decides to work and then sometimes not work when It want to.

  1. Worked
    image

  2. Didn’t Work
    image

  3. Didn’t Work
    image

  4. Didn’t Work
    image

  5. Worked
    image

That’s weird. Did the bounce pad detect the player that time?

1 Like

Yes it did, I always made sure to go on it all of the time and the module script that I was using for the functions for each pad went through.

1 Like

I ended up just using this code for now in a local script that I parented to the player. Hopefully I can find a solution for this soon.

local character = script.Parent

character:FindFirstChildOfClass("Humanoid"):ChangeState(Enum.HumanoidStateType.Jumping)

task.delay(5, game.Destroy, script)