iJava
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 29914 |
|
|
| 08 Apr 2015 11:44 PM |
On the wiki I found a function to remove control and another of all the characters in game, but how can I make it specific to a certain character in a serverscript? This is the code found on the wiki
local controllers = {} function removeControl() for _, controller in pairs(game:GetService("ControllerService"):GetChildren()) do controller.Parent = nil table.insert(controllers, controller) end end function resumeControl() for _, controller in pairs(controllers) do controller.Parent = game:GetService("ControllerService") end controllers = {} end
I want to be able to call the functions like removeControl(game.Players.iJava) and resumeControl(game.Players.iJava), how can I do this? Thanks
-Widths |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Apr 2015 11:46 PM |
| You don't, not without RemoteFunctions/RemoteEvents at least. |
|
|
| Report Abuse |
|
|
iJava
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 29914 |
|
|
| 08 Apr 2015 11:48 PM |
There's no method at all? I just want the player to be unable to move temporarily
-Widths |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Apr 2015 11:50 PM |
The ControllerService can only be accessed per client (which is pretty obvious) so if you want to "remove control" of another player, you can't because their controller does not exist to you or the server.
The best way to solve this is using a RemoteFunction/RemoteEvent and tell the client specifically to do it themselves. |
|
|
| Report Abuse |
|
|
iJava
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 29914 |
|
| |
|