Avatar
A global API containing functions to interact with your avatar's metadata, and also to get information about the current script environment
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:
Type | Description |
---|---|
String | - |
Example:
avatar:getName()
getAuthors()
Gets the authors string of this avatar
getAuthors()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getAuthors()
getVersion()
Gets the version string of this avatar
getVersion()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getVersion()
hasTexture()
Gets whether or not this avatar has a texture
hasTexture()
Returns:
Type | Description |
---|---|
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.
- Overload 1
- Overload 2
- Overload 3
- Overload 4
setColor(color)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color | Vector3 | The r,g,b values as a single value | vec(1,1,1) |
Returns:
Type | Description |
---|---|
AvatarAPI | Returns the avatar API for chaining |
setColor(r, g, b)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r | Number | Red color value | 1 |
g | Number | Green color value | Value of r |
b | Number | Blue color value | Value of r |
Returns:
Type | Description |
---|---|
AvatarAPI | Returns 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:
Type | Description |
---|---|
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:
Name | Type | Description | Default |
---|---|---|---|
key | String | - | - |
value | AnyType | - | - |
Returns:
Type | Description |
---|---|
AvatarAPI | - |
Example:
avatar:store("storing", true)
getSize()
Gets the file size of this avatar in bytes
getSize()
Returns:
Type | Description |
---|---|
Number | - |
Example:
avatar:getSize()
getEntityName()
Attempts to get the entity name of this avatar, defaulting to the avatar name
getEntityName()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getEntityName()
getUUID()
Returns the UUID of the owner of this avatar
getUUID()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getUUID()
getNBT()
Gets the NBT data this avatar is stored as
getNBT()
Returns:
Type | Description |
---|---|
Table | - |
Example:
avatar:getNBT()
getBadges()
Aliases: badges()
Gets the user's badges in a string.
getBadges()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getBadges()
hasScriptError()
Gets whether this script currently has stopped due to an error (kinda useless lol)
hasScriptError()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:hasScriptError()
Permissions
getPermissionLevel()
Returns this avatar's current permission level
getPermissionLevel()
Returns:
Type | Description |
---|---|
String | - |
Example:
avatar:getPermissionLevel()
getComplexity()
Gets the current complexity of this avatar
getComplexity()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getComplexity()
getVolume()
figura.docs.avatar.get_volume
getVolume()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getCurrentInstructions()
getInitCount()
Gets the number of initialization instructions of this avatar
getInitCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getInitCount()
getEntityInitCount()
Gets the number of events.ENTITY_INIT instructions of this avatar
getEntityInitCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getEntityInitCount()
getMaxInitCount()
Gets the maximum allowed instructions during initialization as permitted by the viewer
getMaxInitCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxInitCount()
getTickCount()
Gets the number of events.TICK instructions of this avatar last tick
getTickCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getTickCount()
getMaxTickCount()
Gets the maximum allowed instructions in events.TICK as permitted by the viewer
getMaxTickCount()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxRenderCount()
getWorldTickCount()
Gets the number of events.WORLD_TICK instructions of this avatar's last tick
getWorldTickCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getWorldTickCount()
getMaxWorldTickCount()
Gets the maximum allowed instructions in events.WORLD_TICK as permitted by the viewer
getMaxWorldTickCount()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxWorldRenderCount()
getMaxComplexity()
Gets the maximum allowed model complexity (number of faces) as permitted by the viewer
getMaxComplexity()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxComplexity()
getRemainingParticles()
Gets the remaining amount of particles this avatar can summon
getRemainingParticles()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getRemainingParticles()
getMaxParticles()
Gets the maximum allowed number of particles as permitted by the viewer
getMaxParticles()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxParticles()
getRemainingSounds()
Gets the remaining amount of sound this avatar can play
getRemainingSounds()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getRemainingSounds()
getMaxSounds()
Gets the maximum allowed number of sounds as permitted by the viewer
getMaxSounds()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxSounds()
getAnimationComplexity()
Gets the current animation complexity of this avatar
getAnimationComplexity()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getAnimationComplexity()
getMaxAnimationComplexity()
Gets the maximum allowed animation complexity (number of playing channels) as permitted by the viewer
getMaxAnimationComplexity()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxAnimationComplexity()
getAnimationCount()
Gets the number of Lua instructions used within animations
getAnimationCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getAnimationCount()
getMaxAnimationCount()
Gets the maximum allowed Lua instructions in animations as permitted by the viewer
getMaxAnimationCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxAnimationCount()
getBuffersCount()
Returns count of buffers open by this avatar
getBuffersCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getBuffersCount()
getMaxBuffersCount()
Returns maximum allowed count of buffers can be open by this avatar
getMaxBuffersCount()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxBuffersCount()
getMaxTextureSize()
Gets the max dimensions of custom textures that this avatar can create
getMaxTextureSize()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxTextureSize()
getMaxBufferSize()
Gets the max byte buffer size that this avatar can have
getMaxBufferSize()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
avatar:getMaxBufferSize()
canEditVanillaModel()
Gets whether or not the viewer allows your avatar to edit the vanilla models
canEditVanillaModel()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:canEditVanillaModel()
canEditNameplate()
Gets whether or not the viewer allows your avatar to edit your nameplate
canEditNameplate()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:canEditNameplate()
canRenderOffscreen()
Gets whether or not the viewer allows you to render the avatar off-screen
canRenderOffscreen()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:canRenderOffscreen()
canUseCustomSounds()
Gets whether or not the viewer allows your avatar to play custom sounds
canUseCustomSounds()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:canUseCustomSounds()
canHaveCustomSkull()
Gets whether or not your avatar is allowed to have custom player skull
canHaveCustomSkull()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
avatar:canHaveCustomSkull()