Skip to main content

Viewer

Viewer is an alias of Player. It's used to access people who are viewing your avatar to allow access to some host-only functions. All methods available to player are also available under viewer with the addition of those documented below.

Accessed via client:getViewer().

warning

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

For this page assume:

local myViewer = client:getViewer()

getAir()

Gets the remaining amount of air of the player

getAir()

Returns:

TypeDescription
Integer-

Example:

myViewer:getAir()

getAttackCharge()

Returns a fraction (0 to 1) of the charge of the player attack

If less than 1, every attack will result in a weak attack

getAttackCharge()

Returns:

TypeDescription
Number-

Example:

myViewer:getAttackCharge()

getReachDistance()

Returns the current reach distance of the player

getReachDistance()

Returns:

TypeDescription
Number-

Example:

myViewer:getReachDistance()

getStatusEffects()

Returns a table of all of the player's status effects

The table contains sub-tables, each of which contains the name, amplifier, duration, and particle visibility of each status effect

getStatusEffects()

Returns:

TypeDescription
Table-

Example:

for _, effect in pairs(myViewer:getStatusEffects()) do
logTable(effect)
end

isFlying()

Checks if the player is currently flying

isFlying()

Returns:

TypeDescription
Boolean-

Example:

myViewer:isFlying()

isJumping()

Checks if the player is jumping

Note this is only true during the first tick the player started jumping

isJumping()

Returns:

TypeDescription
Boolean-

Example:

myViewer:isJumping()