Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I disable the WSAD keys and spacebar-jump with a script?

Asked by 10 years ago

I found it on the wiki before, but now I find it

2 answers

Log in to vote
1
Answered by
modFrost 130
10 years ago

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:

game:GetService("ControllerService"):ClearAllChildren()

Enable users input:

Instance.new("HumanoidController", game:GetService("ControllerService"))
Ad
Log in to vote
-2
Answered by 10 years ago

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.

Answer this question