How to make the local player jump in a local script

Hello!

I recently made a custom mobile controller and I wanted to makes it so when you drag your finger up it makes you jump but using Humanoid.Jump doesn’t look to do anything if set on the client and not the server.

Would there be a way to make the player jump with a local script whitout having to use remote events?

Thank !

I don’t think is even possible. You need the rest of the server to see you jump. Use a RemoteEvent.

I found what I needed.

Setting the humanoid state works but not .Jump.
Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)

1 Like

You can use the Humanoid ChangeState method. This allows you to modify the Humanoid’s state — As well as making it jump.

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local LocalCharacter = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local LocalHumanoid = LocalCharacter:WaitForChild("Humanoid")

task.delay(3, function()
    LocalHumanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end)
3 Likes