I want to make a script that will disable the player's ability to move their character, but still allow other scripts to move the character. I tried setting the character's walkspeed to 0, but then I couldn't move it with my own scripts. I was wondering if there's some sort of function I could use to basically disable WASD. Thank you for reading!
✓ ANSWER ACCEPTED
How do I Disable Player Movement?
2 answers
✓ Accepted answer
Here you go:
This Is From A Local Script Inside Of StarterPlayerScripts
local MC = require(game:GetService("Players").LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule"):WaitForChild("ControlModule"))
MC:Disable()
Best way to go about it is disable the core controls script.
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
controls:Disable()
3 comments
0
If I then used that script and said controls:Enable() will it go back to normal?
0
Aye. It should.
0
Thank you!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
lol
Oh no I don't know which one to accept :(