Hello, I have done due diligence, googled, and searched the Developer Hub to no avail. I cannot figure out how to bind a new key to Jumping. I am NOT requesting you to script it for me. I am asking for an explanation of what I'd need to do to make the script myself.
Hello there.
You must use ContextActionService. It is used for binding actions to keys.
You can first unbind the jump action by using ContextActionService:UnbindAction("jumpAction").
Then, you can use UserInputService to detect the input when the player jumped.
Example Code:
local UserInputService = game:GetService("UserInputService") local ContextActionService = game:GetService("ContextActionService") ContextActionService:UnbindAction("jumpAction") UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.LeftControl and gameProcessedEvent then local character = game:GetService("Players").LocalPlayer.Character if character then if character.Humanoid.Health > 0 then character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end end end end)
How it Works
You must first unbind the "jumpAction" action. Then, you must use the InputBegan
event of UserInputService to detect when the client makes an action. Next, you must check if the KeyCode is the KeyCode you want and that the player isn't in chat. I used LeftControl
as the jump key. Then, you must check if the character isn't nil and if the character's health is above 0. If it is, the humanoid will then jump.
Please accept this answer if it helped.
What I think that will work is use a body force or something like that and make it move the player upwards, then just set the jump power to 0. It is probably not the best way but it should work.