nut.char.delete - brianhang/nutscript2 GitHub Wiki
Description
nut.char.delete(id, callback, temporary)
This server function deletes a character whose ID matches id. callback is called after the character has been deleted.
Parameters
| Name | Description |
|---|---|
id |
A number that is the ID of the desired character. |
callback |
An optional function that runs once the character has been deleted. At this point there is no more access to the character. |
temporary |
An optional boolean on the server which causes the character to not be permanently deleted. This is useful for just destroying Character objects. |
Side Effects
- The character is deleted from the database.
- The reference to the character in
nut.char.listis removed. - The CharacterDeleted hook is called after the character has been deleted.
Errors
idis not anumber
Example
-- Deletes character #2.
nut.char.delete(2)