Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to disable control of players character?

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 (:

2 comments

0

You can use the ":MoveTo()" method in the player's humanoid

0

@GeezuzFusion I know, but the player can move when I do that.

1 answer

✓ Accepted answer

New Code

local plr = game.Players.LocalPlayer
repeat wait() until plr.PlayerScripts
if plr.PlayerScripts then 
	plr.PlayerScripts:Destroy()
end

1 comment

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.