Garry's Mod Wiki

Garry's Mod Wiki

  player_manager.RegisterClass( string name, table table, string base = nil )

Description

Register a class metatable to be assigned to players later.

Arguments

1 string name
Class name.
2 table table
Class metatable, see PLAYER structure.
3 string base = nil
Base class name.

Example

A quick look at registering a class table.

local PLAYER = {} PLAYER.DisplayName = "Default Class" -- ... player_manager.RegisterClass( "player_default", PLAYER, nil )

Example

You can retrieve the data you've set when registering the table using baseclass.Get( "<classname>" ).

PrintTable( baseclass.Get( "player_default" ) )
Output:
Walkspeed = 300 RunSpeed = 500 CalcView = function: 0x00665988 UseVMHands = true --- etc...

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...