Yeah so I just need to know how I can make it so a user can’t walk at all, but can still jump. And I need the GoTo() function to still work, therefore I can’t set the walkspeed to 0 as a solution. I know I need to unbind walk actions through contextactionservice. Let me know, any help is useful fr
Use ContextActionService, bind an action, set the priority of WASD and the arrows to a high number and now the player is unable to move their character, while still being allowed to use :GoTo() else you can spam the function every single frame or when you detect the player not going into the correct direction.
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessedEvent then
local keyPressed = input.KeyCode
if keyPressed == Enum.KeyCode.W or keyPressed == Enum.KeyCode.A or keyPressed == Enum.KeyCode.S or keyPressed == Enum.KeyCode.D then
humanoid:Move(Vector3.new(0, 0, 0), true)
end
end
end)
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
humanoid.WalkSpeed = 16 -- Ensure walk speed is normal during jumping
end)
Override the users input
This seems like an AI ahh response, thanks for the answer but it doesn’t suffice, also only works for keyboard players, also why would I want them to walk to 0,0,0?
I think there’s a way for you to detect a player’s input device and then you can stop them from there?maybe?
You said walkSpeed can’t be zero… can it be negative? (Idk I’m not a scripter)
what if you tried looking into whatever cutscenes use to stop the player from moving.