Missing hands (STILL) on everything, dedicated server, custom gamemode?

Okay, I’ve literally tried everything.

In my custom gamemode’s shared.lua file, I’ve included both the BASE playerclass lua file, and the SANDBOX playerclass lua file, and edited them accordingly, so that the class name works.

So, I have both the player class files from sandbox and base in my custom gamemode.

When I do this,

[lua]
function GM:PlayerSpawn (ply) player_manager.SetPlayerClass( ply, “player_sbsandbox” )
[/lua]

Where player_sbsandbox is the custom name of the player class ( I just added the letters sb to the default and sandbox player class files, edited them accordingly),

I STILL DON’T HAVE HANDS ON MY WEAPONS OR TOOLGUN. This is a dedicated server.

I don’t understand what else to do.

Can anyone help me please?

Add this to the beginning of the file player_sbsandbox.lua:


DEFINE_BASECLASS( "player_default" )

And add this to your class spawn function:



function PLAYER:Spawn()

	BaseClass.Spawn( self )

end



[editline]10th May 2013[/editline]

OR you can just add this to your PLAYER:Spawn() or whereever you spawn player:



local oldhands = self.Player:GetHands();
	if ( IsValid( oldhands ) ) then
		oldhands:Remove()
	end

	local hands = ents.Create( "gmod_hands" )
	if ( IsValid( hands ) ) then
		hands:DoSetup( self.Player )
		hands:Spawn()
	end	

P.S. You really should study how base and sandbox have done this before asking questions.

You forgot to do player_manager.RunClass(client, “Spawn”)

Thank you. The problem was missing this:

[lua] player_manager.RunClass(client, “Spawn”) [/lua]

However, on each spawn, this error message appears:

[lua]
[ERROR] lua/matproxy/player_color.lua:43: bad argument #2 to ‘SetVector’ (Vector expected, got no value)

  1. SetVector - [C]:-1
  2. bind - lua/matproxy/player_color.lua:43
    3. unknown - lua/includes/modules/matproxy.lua:56
    [/lua]

Garry’s Mod bug. If it bothers you, use Garry’s fix until the next update arrives.

Thank you!