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
| Field | Description |
|---|---|
start | Action has just begun (e.g. mouse button pressed) |
held | Action is being maintained (e.g. mouse button held down) |
end | Action has just finished (e.g. mouse button released) |
AddonStatus
| Field | Description |
|---|---|
notFound | Addon was not found in the addons directory |
disabled | Addon is present but disabled |
enabled | Addon is present and enabled |
AlphaMode
| Field | Description |
|---|---|
opaque | Fully opaque rendering |
blend | Blends pixel color with the color behind it |
premultiplied | Similar to blend, assumes RGB is premultiplied |
add | Additive blending for light effects |
multiply | Combines pixel color with color behind, darkens |
BrickMaterial
| Field | Description |
|---|---|
plastic | Standard plastic brick material |
transparent | Transparent material with alpha blending |
metallic | Metallic material with reflective properties |
glow | Emissive glowing material |
smooth | Removes all textures from a brick |
blink | Pulsates light/dark from the base color |
BrickModifier
| Field | Description |
|---|---|
cuboid | Standard rectangular shape |
arch | Curved arch shape |
octagon | Eight-sided octagonal shape |
round | Cylindrical round shape |
crest | Double-sided ramp crest shape |
ramp | Vertical ramp shape |
wedge | Horizontal ramp wedge shape |
BrickOrientation
| Field | Description |
|---|---|
xPos | Positive X-axis orientation |
xNeg | Negative X-axis orientation |
yPos | Positive Y-axis orientation |
yNeg | Negative Y-axis orientation |
zPos | Positive Z-axis orientation |
zNeg | Negative Z-axis orientation |
BrickRotation
| Field | Description |
|---|---|
deg0 | 0 degree rotation |
deg90 | 90 degree rotation |
deg180 | 180 degree rotation |
deg270 | 270 degree rotation |
BrickTexture
| Field | Description |
|---|---|
top | Stud top texture |
side | Beveled side texture |
bottom | Inlet bottom texture |
ramp | Ramp surface texture |
BrickType
| Field | Description |
|---|---|
procedural | Procedurally generated BrickData |
custom | Custom user-defined BrickData |
ColorMode
| Field | Description |
|---|---|
rgb | RGB color value (r, g, b) |
index | Color palette index [x, y] |
CrestType
| Field | Description |
|---|---|
straight | Straight crest shape |
corner | Corner crest shape |
tJunction | T-junction crest shape |
xJunction | X-junction crest shape |
end | End piece crest shape |
EntityOwner
| Field | Description |
|---|---|
ground | Ground entity ownership |
sun | Sun entity ownership |
map | Map entity ownership |
chunk | Chunk entity ownership |
player | Player entity ownership |
script | Script entity ownership |
MeshCollider
| Field | Description |
|---|---|
convex | Convex mesh collision |
triangle | Triangle mesh collision |
RampType
| Field | Description |
|---|---|
straight | Straight ramp type |
cornerInner | Inner corner ramp type |
cornerInnerFlat | Flat inner corner ramp type |
cornerOuter | Outer corner ramp type |
cornerOuterFlat | Flat outer corner ramp type |
end | End piece ramp type |
RigidBody
| Field | Description |
|---|---|
fixed | Fixed RigidBody, won't move |
dynamic | Dynamic RigidBody, freely moves |
kinematicPosition | Only moved by positional changes |
kinematicVelocity | Only moved by velocity changes |
TimeMode
| Field | Description |
|---|---|
ticks | Time in ticks |
seconds | Time in seconds |