I havent been able to figure out why I cant disable a player’s name and health from appearing when you look at them. The info above their head is normal.
hook.Add( “HUDDrawTargetID”, “removeid”, function()
It seems that if you want the player info on the top to only draw when you’re looking at the player, you should override the hook Invule posted with your drawing code. For an example look at the base code: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/gamemode/cl_targetid.lua
If you want to just disable it the more “correct” way to do it would be the example in this wiki page:
Although Invule’s code would still work fine.