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()
.
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:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Number | - |
Example:
myViewer:getAttackCharge()
getReachDistance()
Returns the current reach distance of the player
getReachDistance()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Table | - |
Example:
for _, effect in pairs(myViewer:getStatusEffects()) do
logTable(effect)
end
isFlying()
Checks if the player is currently flying
isFlying()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Boolean | - |
Example:
myViewer:isJumping()