How do you make it so that a player loses control of their character? As in, when they press the arrow keys they do not move? I thought that what gave Players control was the HumanoidRootPart, but deleting it just made my character sink through the ground, so now I'm stumped.
(what I'm really trying to accomplish is how to make it so that the Player can't move their character around, and this was the only way I could think of).
Every player has a Controller
object in the ControllerService
. Removing that object will prevent the player from controlling their character, and putting it back gives them control of their character again.
Here is an example from the wiki. (This is done from a local script.)
local controllerService = game:GetService("ControllerService") local controller = controllerService:GetChildren()[1] controller.Parent = nil --Removes control of the character. wait(5) controller.Parent = controllerService --Gives control back.