Skip to main content

CRole.Register

Registers a custom role.

Syntax

CRole.Register id "display_name" role_type *spawn_system? remove_role_on_death?

Arguments

NameRequiredTypeDescription
idYesText with no spaces e.g. someValue (quotes are not required)This will be used to identify the role.
display nameYesAny text e.g. "Hello, World!"
role typeYesRoleTypeId enum value - found using 'serhelp RoleTypeId' command
spawn systemNoa reference to CustomRoleSpawnSystem object.Default: the role will not be spawned automatically
remove role on deathNobool (true or false) valueDefault: True

Possible errors

  • Display name uses an invalid format.

Validated examples using this method

On a running server

Use serhelp CRole.Register to inspect the reference generated by your installed SER version.