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?

function removeControl()
    local cs = game:GetService("ControllerService")
    for i, v in pairs(cs:GetChildren())do
        v.Parent = nil
    end
end
removeControl()

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

local c = script.Parent:WaitForChild("ControlScript")
function returnControls()
    c.Parent = script.Parent
end
function removeControls()
    c.Parent = nil
end
removeControls()
wait(5)
returnControls()

Hope it helps!

Answer this question