Nut.char.create

From Nutscript Developer Wiki
    nut.char.create(data, callback)

This function creates new character in the database of the server. You can create new character with this function. It's role is very different to nut.char.new

Arguments[edit]

  • Table data
  • Function callback

Return Values[edit]

none. If you want to get the character class from the database, You need to go with the callback.

In the callback, database returns these data.

  • Table data
  • Integer charID

Examples[edit]

Will create a character named John, a description of 'Default description', and the first faction to be loaded by the server. The character ID will be printed to the console.

   nut.char.create({
   name    = "John",
   desc    = "Default description",
   model   = "models/humans/group01/male_01.mdl",
   steamID = client:SteamID64(),
   faction = nut.faction.indices[1] and nut.faction.indices[1].uniqueID,
   money   = 50
   }, function(id) print("The character ID is " .. id) end)