Skip to main content

Avatar

A global API containing functions to interact with your avatar's metadata, and also to get information about the current script environment

warning

This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.


Metadata

getName()

Gets the name string of this avatar

getName()

Returns:

TypeDescription
String-

Example:

avatar:getName()

getAuthors()

Gets the authors string of this avatar

getAuthors()

Returns:

TypeDescription
String-

Example:

avatar:getAuthors()

getVersion()

Gets the version string of this avatar

getVersion()

Returns:

TypeDescription
String-

Example:

avatar:getVersion()

hasTexture()

Gets whether or not this avatar has a texture

hasTexture()

Returns:

TypeDescription
Boolean-

Example:

avatar:hasTexture()

setColor()

Aliases: color()

Sets the current color string of your avatar, used as your avatar theme, if the user has a special badge, they can pass in the badge's name to set the color for it.

The color is a value between 0 and 1. Standard RGB values can be divided by 255 to get a number the function can use.

setColor(r, g, b)

Parameters:

NameTypeDescriptionDefault
rNumberRed color value1
gNumberGreen color valueValue of r
bNumberBlue color valueValue of r

Returns:

TypeDescription
AvatarAPIReturns the avatar API for chaining

Example:

avatar:setColor(50 / 255, 0 / 255, 64 / 255)

getColor()

Gets the current color string of your avatar, used as your avatar theme

getColor()

Returns:

TypeDescription
String-

Example:

avatar:getColor()

Misc

store()

Store the given key-value pair inside your current avatar's metadata

Someone else can get this information from a different script with the avatarVars() function in World

The key must be a string

store(key, value)

Parameters:

NameTypeDescriptionDefault
keyString--
valueAnyType--

Returns:

TypeDescription
AvatarAPI-

Example:

avatar:store("storing", true)

getSize()

Gets the file size of this avatar in bytes

getSize()

Returns:

TypeDescription
Number-

Example:

avatar:getSize()

getEntityName()

Attempts to get the entity name of this avatar, defaulting to the avatar name

getEntityName()

Returns:

TypeDescription
String-

Example:

avatar:getEntityName()

getUUID()

Returns the UUID of the owner of this avatar

getUUID()

Returns:

TypeDescription
String-

Example:

avatar:getUUID()

getNBT()

Gets the NBT data this avatar is stored as

getNBT()

Returns:

TypeDescription
Table-

Example:

avatar:getNBT()

getBadges()

Aliases: badges()

Gets the user's badges in a string.

getBadges()

Returns:

TypeDescription
String-

Example:

avatar:getBadges()

hasScriptError()

Gets whether this script currently has stopped due to an error (kinda useless lol)

hasScriptError()

Returns:

TypeDescription
Boolean-

Example:

avatar:hasScriptError()

Permissions

getPermissionLevel()

Returns this avatar's current permission level

getPermissionLevel()

Returns:

TypeDescription
String-

Example:

avatar:getPermissionLevel()

getComplexity()

Gets the current complexity of this avatar

getComplexity()

Returns:

TypeDescription
Integer-

Example:

avatar:getComplexity()

getVolume()

figura.docs.avatar.get_volume

getVolume()

Returns:

TypeDescription
Integer-

Example:

avatar:getVolume()

getCurrentInstructions()

Gets the current number of instructions that have been executed by your avatar

Resets to 0 at the beginning of certain events

getCurrentInstructions()

Returns:

TypeDescription
Integer-

Example:

avatar:getCurrentInstructions()

getInitCount()

Gets the number of initialization instructions of this avatar

getInitCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getInitCount()

getEntityInitCount()

Gets the number of events.ENTITY_INIT instructions of this avatar

getEntityInitCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getEntityInitCount()

getMaxInitCount()

Gets the maximum allowed instructions during initialization as permitted by the viewer

getMaxInitCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxInitCount()

getTickCount()

Gets the number of events.TICK instructions of this avatar last tick

getTickCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getTickCount()

getMaxTickCount()

Gets the maximum allowed instructions in events.TICK as permitted by the viewer

getMaxTickCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxTickCount()

getRenderCount()

Gets the number of instructions of this avatar's last frame from all render events (all events with render in their name) and the setXRender() functions from the models api

getRenderCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getRenderCount()

getMaxRenderCount()

Gets the maximum allowed instructions as permitted by the viewer from all render events (all events with render in their name) and the setXRender() functions from the models api

getMaxRenderCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxRenderCount()

getWorldTickCount()

Gets the number of events.WORLD_TICK instructions of this avatar's last tick

getWorldTickCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getWorldTickCount()

getMaxWorldTickCount()

Gets the maximum allowed instructions in events.WORLD_TICK as permitted by the viewer

getMaxWorldTickCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxWorldTickCount()

getWorldRenderCount()

Gets the number of events.WORLD_RENDER and events.POST_WORLD_RENDER instructions of this avatar's last frame

getWorldRenderCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getWorldRenderCount()

getMaxWorldRenderCount()

Gets the maximum allowed instructions in events.WORLD_RENDER and events.POST_WORLD_RENDER as permitted by the viewer

getMaxWorldRenderCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxWorldRenderCount()

getMaxComplexity()

Gets the maximum allowed model complexity (number of faces) as permitted by the viewer

getMaxComplexity()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxComplexity()

getRemainingParticles()

Gets the remaining amount of particles this avatar can summon

getRemainingParticles()

Returns:

TypeDescription
Integer-

Example:

avatar:getRemainingParticles()

getMaxParticles()

Gets the maximum allowed number of particles as permitted by the viewer

getMaxParticles()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxParticles()

getRemainingSounds()

Gets the remaining amount of sound this avatar can play

getRemainingSounds()

Returns:

TypeDescription
Integer-

Example:

avatar:getRemainingSounds()

getMaxSounds()

Gets the maximum allowed number of sounds as permitted by the viewer

getMaxSounds()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxSounds()

getAnimationComplexity()

Gets the current animation complexity of this avatar

getAnimationComplexity()

Returns:

TypeDescription
Integer-

Example:

avatar:getAnimationComplexity()

getMaxAnimationComplexity()

Gets the maximum allowed animation complexity (number of playing channels) as permitted by the viewer

getMaxAnimationComplexity()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxAnimationComplexity()

getAnimationCount()

Gets the number of Lua instructions used within animations

getAnimationCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getAnimationCount()

getMaxAnimationCount()

Gets the maximum allowed Lua instructions in animations as permitted by the viewer

getMaxAnimationCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxAnimationCount()

getBuffersCount()

Returns count of buffers open by this avatar

getBuffersCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getBuffersCount()

getMaxBuffersCount()

Returns maximum allowed count of buffers can be open by this avatar

getMaxBuffersCount()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxBuffersCount()

getMaxTextureSize()

Gets the max dimensions of custom textures that this avatar can create

getMaxTextureSize()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxTextureSize()

getMaxBufferSize()

Gets the max byte buffer size that this avatar can have

getMaxBufferSize()

Returns:

TypeDescription
Integer-

Example:

avatar:getMaxBufferSize()

canEditVanillaModel()

Gets whether or not the viewer allows your avatar to edit the vanilla models

canEditVanillaModel()

Returns:

TypeDescription
Boolean-

Example:

avatar:canEditVanillaModel()

canEditNameplate()

Gets whether or not the viewer allows your avatar to edit your nameplate

canEditNameplate()

Returns:

TypeDescription
Boolean-

Example:

avatar:canEditNameplate()

canRenderOffscreen()

Gets whether or not the viewer allows you to render the avatar off-screen

canRenderOffscreen()

Returns:

TypeDescription
Boolean-

Example:

avatar:canRenderOffscreen()

canUseCustomSounds()

Gets whether or not the viewer allows your avatar to play custom sounds

canUseCustomSounds()

Returns:

TypeDescription
Boolean-

Example:

avatar:canUseCustomSounds()

canHaveCustomSkull()

Gets whether or not your avatar is allowed to have custom player skull

canHaveCustomSkull()

Returns:

TypeDescription
Boolean-

Example:

avatar:canHaveCustomSkull()