Skip to main content

Enum Table

Intro

The Enum table contains every Enum used in the Lua API as well as their variants as nested tables. Variants are represented as plain Lua strings and are stored in the table for optional readability/verbosity.

-- The TimeMode enum is used to set up a tick-based timer or a second-based timer
local t = Timer.new(Enum.TimeMode.ticks)

Enum variants can also optionally be represented by their string values without needing to reference the Enum table.

-- Variant string values are identical to the key used to index their parent table
print(Enum.ColorMode.rgb == 'rgb')
--> true

-- Variants are case-sensitive
print(Enum.ColorMode.rgb == 'RGB')
--> false

Examples

This example hooks the PrimaryFire Action and compares the actionState variant to determine if the Player has just started clicking.

local function clickJump(player, actionState)
-- Only run the jump logic if the player has just started clicking
if actionState == Enum.ActionState.start then
-- Add some upwards velocity to the player
player.velocity += Vector3.new(0, 10, 0)
end

-- Return the hook params to the next function being chained
return player, actionState
end

-- Register 'clickJump' to fire before action PrimaryFire has been executed
Hook.Action:Connect(clickJump, 'before', 'PrimaryFire')

Fields

ActionState

FieldDescription
startAction has just begun (e.g. mouse button pressed)
heldAction is being maintained (e.g. mouse button held down)
endAction has just finished (e.g. mouse button released)

AddonStatus

FieldDescription
notFoundAddon was not found in the addons directory
disabledAddon is present but disabled
enabledAddon is present and enabled

AlphaMode

FieldDescription
opaqueFully opaque rendering
blendBlends pixel color with the color behind it
premultipliedSimilar to blend, assumes RGB is premultiplied
addAdditive blending for light effects
multiplyCombines pixel color with color behind, darkens

BrickMaterial

FieldDescription
plasticStandard plastic brick material
transparentTransparent material with alpha blending
metallicMetallic material with reflective properties
glowEmissive glowing material
smoothRemoves all textures from a brick
blinkPulsates light/dark from the base color

BrickModifier

FieldDescription
cuboidStandard rectangular shape
archCurved arch shape
octagonEight-sided octagonal shape
roundCylindrical round shape
crestDouble-sided ramp crest shape
rampVertical ramp shape
wedgeHorizontal ramp wedge shape

BrickOrientation

FieldDescription
xPosPositive X-axis orientation
xNegNegative X-axis orientation
yPosPositive Y-axis orientation
yNegNegative Y-axis orientation
zPosPositive Z-axis orientation
zNegNegative Z-axis orientation

BrickRotation

FieldDescription
deg00 degree rotation
deg9090 degree rotation
deg180180 degree rotation
deg270270 degree rotation

BrickTexture

FieldDescription
topStud top texture
sideBeveled side texture
bottomInlet bottom texture
rampRamp surface texture

BrickType

FieldDescription
proceduralProcedurally generated BrickData
customCustom user-defined BrickData

ColorMode

FieldDescription
rgbRGB color value (r, g, b)
indexColor palette index [x, y]

CrestType

FieldDescription
straightStraight crest shape
cornerCorner crest shape
tJunctionT-junction crest shape
xJunctionX-junction crest shape
endEnd piece crest shape

EntityOwner

FieldDescription
groundGround entity ownership
sunSun entity ownership
mapMap entity ownership
chunkChunk entity ownership
playerPlayer entity ownership
scriptScript entity ownership

MeshCollider

FieldDescription
convexConvex mesh collision
triangleTriangle mesh collision

RampType

FieldDescription
straightStraight ramp type
cornerInnerInner corner ramp type
cornerInnerFlatFlat inner corner ramp type
cornerOuterOuter corner ramp type
cornerOuterFlatFlat outer corner ramp type
endEnd piece ramp type

RigidBody

FieldDescription
fixedFixed RigidBody, won't move
dynamicDynamic RigidBody, freely moves
kinematicPositionOnly moved by positional changes
kinematicVelocityOnly moved by velocity changes

TimeMode

FieldDescription
ticksTime in ticks
secondsTime in seconds