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!
Here you go:
This Is From A Local Script Inside Of StarterPlayerScripts
1 | local MC = require(game:GetService( "Players" ).LocalPlayer:WaitForChild( "PlayerScripts" ):WaitForChild( "PlayerModule" ):WaitForChild( "ControlModule" )) |
2 | MC:Disable() |
Best way to go about it is disable the core controls script.
1 | local controls = require(game:GetService( "Players" ).LocalPlayer.PlayerScripts.PlayerModule):GetControls() |
2 | controls:Disable() |