Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
Edited 6 years ago

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.

0
Nevermind, problem solved. EatableDragonkight 3 — 6y
0
I just had to add a upwards velocity to the BodyVelocity, + Vector3.new(0,10,0) EatableDragonkight 3 — 6y

2 answers

Log in to vote
2
Answered by 6 years ago

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

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. User#15746 0 — 4y
Ad
Log in to vote
2
Answered by 6 years ago

Yea, you could have just done

local humanoid = char.Humanoid
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
0
Thanks a lot! That helped me!! Anshu4337 0 — 4y

Answer this question