Disable a single player input | Scripting

  • I want to stop the player JUMP input ONLY without having to set the jump power/height value to 0.

  • I tried using the following code:

local contextActionService = game:GetService("ContextActionService")
local players = game:GetService("Players")

local localPlayer = players.LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local humanoid = character.Humanoid

task.wait(3)
contextActionService:BindAction("freeze", function() return Enum.ContextActionResult.Sink end, false, unpack(Enum.PlayerActions:GetEnumItems()))

But its disabling all the player inputs, not only the jump input.

  • Thanks for reading!

2 options:

1- Disable the humanoid state related with jumping. This won’t disable the input however it’ll disable jumping.

2- Binding an action higher priority than default jump and then sinking the input.

You actually did the second one however you made a mistake.

This basically disables all the player actions. Just use the Enum.PlayerActions.CharacterJump instead of the unpack.

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