How Do I Disable Movement Control Like (WASD) But I Can Use The Button?

I’m using this script to disable plr movement but idk why it disable then i can’t use script like:

game:GetService("UserInputService").InputEnded:Connect(function(input, IsTyping)
       if input.KeyCode == Enum.KeyCode.W then
               --STH
       end
end)

Script Disable Move:
local ContextActionService = game:GetService(“ContextActionService”)

local Arguments = {false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Up, Enum.KeyCode.Down, Enum.KeyCode.Left, Enum.KeyCode.Right, Enum.KeyCode.A, Enum.KeyCode.W, Enum.KeyCode.S, Enum.KeyCode.D}

ContextActionService:BindActionAtPriority("DisableArrowKeys", function()

return Enum.ContextActionResult.Sink

end, unpack(Arguments))

Can someone help me pls

you could just set the humanoid’s walk speed and jump power to 0 if all you want is make them unable to move
or you could anchor the HumanoidRootPart but the downside of this is that if you do it when the player is in the air they would just stay there

local moveModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayersModule")

local moveControls = moveModule:GetControls()

moveControls:Disable()
2 Likes

Use DevComputerMovementMode you can change this to Enum.DevComputerMovementMode.Scriptable and disable the player being able to move with WASD.

1 Like