Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] How do i force the player to jump?

I am making this script that should launch the player forward using a BodyVelocity and i want the player to jump because otherwise the velocity would decrease allot than if the player were to actually jump.

This is my current script:

local player = game.Players.LocalPlayer
local char = player.Character
local rootpart = char.HumanoidRootPart
char.Humanoid.Jump = true
local force = Instance.new("BodyVelocity",rootpart)
force.Velocity = rootpart.CFrame.lookVector * Vector3.new(50,0,50)

But the problem is that the char.Humanoid.Jump = true doesn't make the character jump. So what i am asking is Can i force the player to jump? Is that even possible?

If this is not possible, please let me know if there is a way to force the player to jump.

2 comments

0

Nevermind, problem solved.

0

I just had to add a upwards velocity to the BodyVelocity, + Vector3.new(0,10,0)

2 answers

You could have just got the player's jump property set to true. lol

1 comment

0

Well, they say "char.Humanoid.Jump = true doesn't make the character jump." Which I just tried on client, and it doesn't work because that property doesn't replicate. It would have to be on the server-side for it to work, by the first line in his code, we can tell it's client.

Yea, you could have just done

local humanoid = char.Humanoid
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)

1 comment

0

Thanks a lot! That helped me!!

This discussion is preserved as it was. New answers, comments, and votes are closed.