Creating New Player Class

Class Functions

  • Init() - [OPTIONAL] class initialization.

  • Update() - [OPTIONAL] called every frame.

  • OnStop() - [OPTIONAL] called on class destroy.

  • OnEscape() - [OPTIONAL] called when players escapes(Trigger on surface at Exit B).

  • GetHand() - [REQUIRED] return hand material ID(required only for classes that can pickup items).

  • GetName() - [REQUIRED] displayed class name.

  • GetTeamID() - [REQUIRED] class team.

  • GetClassColor() - [REQUIRED] class color in HEX.

  • GetPlayerInfo(HitBox) - [OPTIONAL] additional information when player looks at someone, return string [DEFAULT: ""].

  • GetDeadInfo(DeadBox) - [OPTIONAL] additional information when player looks at dead body, return string [DEFAULT: ""].

  • OnOpenInventory() - [OPTIONAL] can this class open inventory, return boolean [DEFAULT: false].

  • IgnoreSCP() - [OPTIONAL] is this class ignore all scp mechanics, return boolean [DEFAULT: false].

  • CheckpointPass() - [OPTIONAL] can this class open checkpoints without key card, return boolean [DEFAULT: false].

  • CanTakeDamage() - [OPTIONAL] can this class take damage, return boolean [DEFAULT: true].

  • OnTakeDamage(DamageHandler) - [OPTIONAL] called when player takes damage.

Local Properties

  • player - return current Player class.

  • playerModel - shared property, that must be assigned from player class.

Local Functions

  • SendToEveryone(string FunctionName, params object[] arguments) - send command to every player to call function with arguments.

  • SendToClient(string FunctionName, NetworkConnection connection, params object[] arguments) - send command to player with connection to call function with arguments.

  • SendToServer(string FunctionName, params object[] arguments) - send command to server to call function with arguments.

  • Invoke(Function, float seconds) - same logic as UnityEngine.Object.Invoke, call function after time.

Example

Example Solution can be downloaded here: Link to archive

Testing

Now we can compile this plugin and move library to server plugins folder according to Folder Structure Now we can force class:

Last updated