I want to know if there's a way to keep players from moving on their own, and control their movements by a script. I want them to be controlled for a short amount of time, making their keyboards inputs unresponsive to them. Is there a way?
How do I disconnect the Keyboard to prevent players from moving, then connect it back?
1 answer
The main way you can do this is to mess with the Player's control script. Every player that enters the game comes with player scripts just like GUIs. What makes them difficult though is that:
1: they are not in the StarterPlayer in Studio 2. They are not visible to the server
To overcome this, simply
- Start a local play
- Go into the Player, look under PlayerScripts
- Copy the ControlScript (make sure it is Archivable or it won't copy)
- Close local play so you are in the studio again
- Paste the script into the StarterPlayerScripts in StarterPlayer
By doing this, the game will use this script for the moving script instead of it's default. Now you can look through it and edit it however you want. Just remember though that these are not visible to the server, so you can't use server scripts to edit them.
Another way you can do this is by simply putting you own LOCAL script into the StarterPlayerScripts that disables and enables the script when you choose. Yes, you can simply disable the ControlScript to stop them from moving and enable it to have them move again.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Wow Thanks, never thought of it that way