level

level <creature>

The experience level of a creature.

Arguments

Returns

An int — the creature's level.

Examples

after command (say) {
  do "say You are level [level $actor]."
}

When the actor is a level-26 creature, [level $actor] evaluates to 26, and the mob says "You are level 26."

Levels are ordinary integers, so they compare with the operators:

before command (enter) {
  require [ge [level $actor] 10]
}

This guard lets the handler run only for actors of level 10 or higher; otherwise the script advances to the next matching handler (see require).

See also