How would I change the controls to make it so W to jump, and disable S from moving backwards

Basically I just need to change the controls so that W makes you jump and Stop S from making you go backwards.

I’ve tried changing the controls on my own and I cant figure it out

You could use UserInputService to detect when the player does an input with “W” using this:

UserInputService.InputBegan:Connect(function(input) -- Event
   if input.KeyCode == Enum.KeyCode.E then -- If key pressed is E then
      game:GetService("Players").LocalPlayer.Character.Humanoid.Jump = true -- Making the player jump
   end
end)

And to stop an input from working, use ContextActionService like how I used it below:

local function OnSPress(actionName, inputState, inputObj)
   -- do whatever you want here. Or do nothing.
end

ContextActionService:BindActionAtPriority("Punch", OnSPress, false, 999, Enum.KeyCode.S) -- Action name, Function, Should create mobile button, Priority, Inputs

Hope this helps! :grin: :wink:

I changed it so I use :ChangeState(Enum.HumanoidStateType.Jumping)
And that works.

BUT!!! I know massive but . . .
But anyhow they still walk forward. I need to OVERRIDE the controls

I figured it out thanks to this post HERE. Its a great tutorial and works amazingly!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.