I've used this before, and it used to work, I'm trying to remove the player's control of their character and this doesn't seem to work. I read about this in the roblox wiki a while back and it worked when I tried it then, did the method change or am I doing it wrong?
1 | function removeControl() |
2 | local cs = game:GetService( "ControllerService" ) |
3 | for i, v in pairs (cs:GetChildren()) do |
4 | v.Parent = nil |
5 | end |
6 | end |
7 | removeControl() |
This is in a LocalScript
Outpu? Have you also tried taking it out of a LocalScript? I didn't think LocalScripts could do things with the Server like ControlService.
Try this: insert a local script into StarterPlayerScripts, if you don't know where that is by now you're like... I dunno... But ask someone where the StarterPlayerScripts are(Hint: It's in Starter Player) and use the following script:
01 | local c = script.Parent:WaitForChild( "ControlScript" ) |
02 | function returnControls() |
03 | c.Parent = script.Parent |
04 | end |
05 | function removeControls() |
06 | c.Parent = nil |
07 | end |
08 | removeControls() |
09 | wait( 5 ) |
10 | returnControls() |
Hope it helps!