nut.char - brianhang/nutscript2 GitHub Wiki

Description

The character library creates functions that make it easy to store roleplay related information for characters. This includes data such as character names, models, jobs, etc... The library makes it easy to create new characters so your gamemode can have players with multiple characters or single characters if desired. To see more about characters, you should see the Character object documentation.

Fields

Name Description
list A list of all loaded character objects.
vars A list of all character variables and their properties.

Functions

Name Description
nut.char.create Creates a new character instance and stores it in the database.
nut.char.delete Removes a character from existence corresponding to the given character ID.
nut.char.insert Inserts a character to the database with given details.
nut.char.load Loads a character from the database into an instance.
nut.char.new Creates a new character object.
nut.char.registerVar Adds a new character variable.
nut.char.validateInfo Checks for the validity of all given character information.

Extensions

Name Description
Player:getChar Returns the active character for a player.

Notes

  • Use the CHARACTERS global variable for accessing the characters table in database queries.
  • Use the CHAR_DATA global variable for accessing the character data table in database queries.