I found it on the wiki before, but now I find it
You can disable the users input by removing the HumanoidController and instancing a new one when you need to enabled the movement.
Disable users input:
1 | game:GetService( "ControllerService" ):ClearAllChildren() |
Enable users input:
1 | Instance.new( "HumanoidController" , game:GetService( "ControllerService" )) |
I'm not sure if you can completely disable the keys, but to prevent movement you can Anchor/Lock a characters Torso with a Script, thus preventing them to move.