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

Removing the player's control isn't working?

Asked by
Mr1Vgy 30
9 years ago

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?

1function removeControl()
2    local cs = game:GetService("ControllerService")
3    for i, v in pairs(cs:GetChildren())do
4        v.Parent = nil
5    end
6end
7removeControl()

This is in a LocalScript

2 answers

Log in to vote
0
Answered by 9 years ago

Outpu? Have you also tried taking it out of a LocalScript? I didn't think LocalScripts could do things with the Server like ControlService.

0
No it doesn't work in a server script and there's no output :P Mr1Vgy 30 — 9y
0
Maybe ControllerService isn't accessible anymore. TheZankonator -2 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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:


Final Product

01local c = script.Parent:WaitForChild("ControlScript")
02function returnControls()
03    c.Parent = script.Parent
04end
05function removeControls()
06    c.Parent = nil
07end
08removeControls()
09wait(5)
10returnControls()

Hope it helps!

Answer this question