Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
Enum
The Enum data type represents an individual enum in Roblox. An individual enum can be indexed through the Enums type, via the name of the enum itself.
Methods
| Name | Type / Returns | Description |
|---|---|---|
| Enum:GetEnumItems | Array | Returns an array of all EnumItem options available for this enum. |
| Enum:FromName | Enum | nil | Converts an enum name to an Enum. |
| Enum:FromValue | Enum | nil | Converts an enum value to an Enum. |
Enum:GetEnumItems
Returns an array of all the EnumItem options available for this enum.
Returns
| Type | Description |
|---|---|
| Array | An array of all EnumItem values belonging to this enum. |
Enum:FromName
Returns either the converted Enum or nil.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| name | string | The name of the EnumItem to look up in this enum. |
Returns
| Type | Description |
|---|---|
| Enum | nil | The EnumItem whose Name matches the given string, or nil if no match exists. |
Enum:FromValue
Returns either the converted Enum or nil.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| value | number | The integer value of the EnumItem to look up in this enum. |
Returns
| Type | Description |
|---|---|
| Enum | nil | The EnumItem whose integer value matches the given number, or nil if no match exists. |