Method PlayerBot.CreateBotPlayer [-] [+]

Creates a new bot character in the database and returns its GUID (low part). The character is created via the standard Player::Create() and saved via SaveToDB(). After creation, use [LoginBotByGuid] to log the character into the world.

Note: SaveToDB() uses async queries internally. If you call [LoginBotByGuid] immediately after, the character data may not be flushed to the database yet. Use a short timer delay.

Synopsis

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender )

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender, skin )

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender, skin, face )

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender, skin, face, hairStyle )

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender, skin, face, hairStyle, hairColor )

guidLow = Playerbot.CreateBotPlayer( accountId, name, race, class, gender, skin, face, hairStyle, hairColor, facialHair )

Arguments

number accountId

The account to create the character on.

Valid numbers: integers from 0 to 4,294,967,295.

string name

Character name.

number race

Race ID (e.g. 1 = Human, 2 = Orc).

Valid numbers: integers from 0 to 255.

number class

Class ID (e.g. 1 = Warrior, 2 = Paladin).

Valid numbers: integers from 0 to 255.

number gender

0 = Male, 1 = Female.

Valid numbers: integers from 0 to 255.

number skin (0)

Skin color index.

Valid numbers: integers from 0 to 255.

number face (0)

Face type index.

Valid numbers: integers from 0 to 255.

number hairStyle (0)

Hair style index.

Valid numbers: integers from 0 to 255.

number hairColor (0)

Hair color index.

Valid numbers: integers from 0 to 255.

number facialHair (0)

Facial hair type index.

Valid numbers: integers from 0 to 255.

Returns

number guidLow

The low part of the new character's GUID, or nil on failure.

Valid numbers: integers from 0 to 4,294,967,295.

Generated on
©2026 - ALE Lua Engine