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

How to disable control of players character?

Asked by 8 years ago

I have the camera set to scriptable and the character's humanoid Walkspeed set to 0 but I need to have the player walk a certain detection without the players control. I've looked at the wiki and it said to do the following,

for _, controller in pairs(game:GetService("ControllerService"):GetChildren()) do
    controller.Parent = nil
end

I made sure to put this in a local script but the player still can control the character when I try to move it.

So how do I do this? I've also tried this,

game.Players.PlayerAdded:connect(function(plr)

    plr.DevComputerMovementMode = "Scriptable"
    plr.DevTouchMovementMode = "Scriptable"

end)

But this doesn't seem to do anything. Any help would be much appreciated (:

0
You can use the ":MoveTo()" method in the player's humanoid GeezuzFusion 200 — 8y
0
@GeezuzFusion I know, but the player can move when I do that. User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

New Code

local plr = game.Players.LocalPlayer
repeat wait() until plr.PlayerScripts
if plr.PlayerScripts then 
    plr.PlayerScripts:Destroy()
end
0
Sorry I took so long to accept but I had to test it. It works! I had to move the PlayerScripts to a folder so I could add them back later but it works! Thanks! User#11440 120 — 8y
Ad

Answer this question