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

Removing the player's control isn't working?

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

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

2 comments

0

No it doesn't work in a server script and there's no output :P

0

Maybe ControllerService isn't accessible anymore.

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!

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