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

Why can't I use a script to make the player jump?

I could've swore this would work in the past. Even manually clicking the button for jump in Humanoid.Jump doesn't make me jump.

uis.InputBegan:connect(function(input,process) 
if not process and input.KeyCode == Enum.KeyCode.B then
          player.Character.Humanoid.Jump = true 
end
end)

6 comments

0

did you try to use a remoteevent ? (im not the humanoid expert)

0

No, I didn't think I would have to. I can change walkspeed no problem with a localscript.

0

Okay i found the problem. You have to make it jump with an RemoteEvent. How do i know? I tested it by test playing, and i set the jump to true in the client, it didnt do anything. Then i went to the server and then made jump true, and it did work.

0

if this is a localscript this should work?

0

nvm

0

use a remoteevent and see if that worked

1 answer

I had a problem recently where setting Humanoid.Jump to true worked in studio but not in game servers, but using Humanoid:SetStateEnabled() worked the other way around. Try this:

local UIS = game:GetService("UserInputService")
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

UIS.InputBegan:Connect(function(key,gameProc)
   if not gameProc then
      if key.KeyCode == Enum.KeyCode.B then
         char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,true)
      end
   end
end)

2 comments

0

you may have to edit this a bit, because using this method might force the player to continuously jump. im not sure though

0

Please fix your naming conventions, thanks.

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