Garry's Mod

Garry's Mod

960 ratings
HB Player Controller
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Comic, Fun
File Size
Posted
Updated
41.987 KB
Feb 18, 2016 @ 7:17am
Dec 6, 2018 @ 4:25pm
7 Change Notes ( view )

Subscribe to download
HB Player Controller

Description
The HB Player Controller is a SWEP that allows you to take direct control of other Players, or even Bots! You control their actions just as if they were doing it themselves, including movement, looking around, aiming, shooting, building, text chatting and much more!

This had been a little side project of mine due to some friends of mine asking if it could be done, and a little something different for me to do than the usual work I normally do on my Server. Written from scratch, it took about two weeks from concept to finished product. This does NOT work on (S)NPCs.
Special thanks to Sf for the Puppeteer image!

Some Cool Features:
Some, but not all features. Explore for more!
  • Works on any Player in a Game, including both Humans and Bots (Including Player NextBots[wiki.garrysmod.com]), leaving them powerless to your control.
  • Take direct control of your Victim, just as if you were them, having them mimmick your movement, actions, etc. and you having the same Usergroup privileges as them.
  • Drive vehicles as your Victim, as if you were the one in the driver's seat, as well as being compatabile with third party vehicles and even the Sit Anywhere Script.
  • Spawn Props, Effects, Ragdolls, SENTs, SWEPs, Vehicles, NPCs etc. as your Victim, as if they were doing it themselves.
  • Manipulate entities as your Victim, using the Physgun, with the ability to move, rotate, freeze, un-freeze etc.
  • Undo actions of your Victim, like you were doing an Undo of one of your own actions, as well as being able to do cleanups as them.
  • Kill or be killed as your Victim, with the ability to use any weapon or tool as them, such as firing weapons, changing weapons, changing toolmodes, reloading weapons, etc.
  • Use Text Chat as your Victim, where anything you say will be shown as something they say to others, as well as the ability to run Console Commands on your Victim.
  • Use the Flashlight and Noclip as your Victim, providing they have access to them of course. Any Impulse Console Command you execute, they shall also execute automatically.
  • Zoom your view when Controlling In or Out, even with the ability to view at their eye position (sort of like Firstperson).
  • Works seamlessly in various Gamemodes, both Sandbox and Non-Sandbox derived, including Sandbox itself, DarkRP, Cinema, etc.
  • Customisable to Server Operators, with included ConVars and logging system which can be altered to your needs.

Usage:
You can hover your mouse over the Player Controller's menu for a (crude) help menu with better in-depth information too (not everything is covered here).
  • !!: Doing this at the start of a Text Chat message will have what comes after it executed as a Command via your Victim's Console (Example: "!! kill").
  • !!!: Doing this at the start of a Text Chat message will have what comes after it said as yourself, not your Victim (Example: "!!! Hello World!").
  • F6: Shows/Hides the mouse cursor (to use the Player Controller menu).
  • F7: Expands/Collapses the Player Controller menu.
  • F8: Ceases control of your Victim (you can also press the 'X' Button in the Player Controller menu).

Console Variables (ConVars):
These are not saved. You will have to add them into your server.cfg or other auto-executed config file if you wish for your own set values to persist between maps/restarts.
  • hb_playercontroller_log - Specifies whether to log Player Controller usage to the Server.
    [0: Disabled | 1: Enabled - Default: 1]
  • hb_playercontroller_log_cl - Specifies whether to log Player Controller usage to Clients.
    [0: Disabled | 1: Everyone | 2: Admins only | 3: Superadmins only - Default: 2]
  • hb_playercontroller_immunity - Specifies whether to use immunity, where users of lower usergroups cannot target users of higher usergroups.
    [0: Disabled | 1: Enabled - Default: 1]
  • hb_playercontroller_access - Specifies the minimum required access rights to use the Player Controller.
    [0: Everyone | 1: Admins only | 2: Superadmins only | 3: Custom-defined - Default: 1]

Some Other Notes:
  • Bots are not real Clients, so lack a Console or any set ConVars. Due to this, you cannot execute Console Commands on them at all, nor can you use the Mouse to move entities to/away from you or rotate them with the Physgun. Use E + W, A, S, D instead (or whatever you have them binded to). The Toolgun is totally unusable on Bots.
  • Not all Console Commands can be executed on your Victim. There is a blacklist[wiki.garrysmod.com] in Garry's Mod of exploitable Commands to prevent abuse (and rightfully so). Attempting to use any of those will do nothing.
  • If Clientside logging is enabled at all, despite the setting, your Victim will receive a log whenever you take control of them, release control of them, or execute a Console Command as them.
  • Remember, when controlling a Victim, what you can do as them is subject to what permissions they have on the Server. If they're a Superadmin with root access, you can do anything (be careful!). If they're a user without even the permission to text chat, then you won't be able to either as them.
  • Using Chat Commands as your Victim can be a little risky. Due to the way they work, it can have it execute both as your Victim and yourself. It's recommended to execute such commands as a Console Command on your victim where possible.
  • I am not at all responsible for how anyone uses this SWEP. This SWEP's usage is at the discrection of the Server Operator(s) who are ultimately responsible for how it gets utilised within their communities.

How to define custom access rights to using the SWEP:
You must have the ConVar "hb_playercontroller_access" set to 3 and hook onto "hb_playercontroller_canAccess" in shared (Client and Server) code. By default, if no function returns false for the hook, anyone will be able to use the SWEP. An Example Function is provided below. Copy and Paste it into a blank .lua file and place that file into:
garrysmod/addons/[New Folder Name]/lua/autorun/
--This Example uses ULib/ULX' CheckGroup function to see if the Controller is in the "operator" usergroup or any inheriting from it, disallowing use of the SWEP if the Controller is NOT an operator or inheriting from. This example will ONLY work if you have ULib and ULX. You can change the "operator" rank for anything you wish. hook.Add("hb_playercontroller_canAccess", "MyCustomRankCheck", function(controller, victim) if not controller:CheckGroup("operator") then return false, "Operators and above only" end end)

How to Use the SWEP without a Server/Other Players (On Bots):
  1. In the Main Menu of Garry's Mod, select "Start New Game".

  2. In the top, right there should be a dropdown box that says "Singleplayer". Select this and change it to anything between "2 Players" up to the max of "128 Players".

  3. Select "Start Game" and wait until you load into the game.

  4. Once loaded, open your Console (Default Bind in Garry's Mod is Shift + Esc) and type in: "bot". This will spawn in a "fake" Player, known as a Bot (what a Bot is can be found in the notes above).

  5. Spawn yourself the HB Player Controller Weapon, aim it at the Bot and enjoy!

GitHub Repository: https://github.com/Hazbelll/HB-PlayerController
Report Issues or Suggestions: Here![github.com]
Popular Discussions View All (8)
12
Dec 6, 2018 @ 4:37pm
Unable to find it
Pierogi
3
Sep 1, 2018 @ 5:29pm
Rebinding Controls
Pepper
2
Jun 12, 2017 @ 8:41pm
Could you add a GUI for this?
-snip-
230 Comments
Crayzy_eyez Jan 28 @ 2:49pm 
i belive this addon needs to be updated when trying to control any players they just get sent in a direction and i hardly have any control over it. i noticed on the github other people were having the same issue
judezma7 Jan 23 @ 7:02pm 
Can you make it where you can become Lambda players and zeta players?
judezma7 Jan 23 @ 6:52pm 
In the Main Menu of Garry's Mod, select "Start New Game".

In the top, right there should be a dropdown box that says "Singleplayer". Select this and change it to anything between "2 Players" up to the max of "128 Players".

Select "Start Game" and wait until you load into the game.

Once loaded, open your Console (Default Bind in Garry's Mod is Shift + Esc) and type in: "bot". This will spawn in a "fake" Player, known as a Bot (what a Bot is can be found in the notes above).

Spawn yourself the HB Player Controller Weapon, aim it at the Bot and enjoy!
djpea Aug 23, 2024 @ 8:51am 
bruh why did you made this mod?
my friend use this and i cant play when he controls me
sorry but worst mod:steamfacepalm:
FunniZac Aug 22, 2024 @ 6:54pm 
F6 didnt activate cursor, friend got mad, day ruined
shadow Jun 4, 2024 @ 9:05am 
I AM THE- wait how do i use?
Pat May 12, 2024 @ 3:23pm 
There's no multiplayer with this
Monika Feb 12, 2024 @ 3:39pm 
I... don't understand how to use this.
engineer gaming #FIXTF2 #SAVETF2 Nov 18, 2023 @ 8:29am 
then how can i spawn bot players with skins
MARC0LE :3 Oct 14, 2023 @ 4:10pm 
please on GOD! make the camera not work, my computer costed me 500 dollars to fix from 3943 gman pictures