Data type
Enum
A data type that represents an individual 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 3#
| GetEnumItems | Returns an array of all EnumItem options available for this
enum. |
| FromName | Converts an enum name to an Enum. |
| FromValue | Converts an enum value to an Enum. |
GetEnumItems(): Array#
Returns an array of all the EnumItem options available for this
enum.
Returns
Array— An array of allEnumItemvalues belonging to this enum.
FromName(name: string): Enum | nil#
Returns either the converted Enum or nil.
| Name | Type | Default | Description |
|---|---|---|---|
name | string | The name of the EnumItem to look up in this enum. |
FromValue(value: number): Enum | nil#
Returns either the converted Enum or nil.
| Name | Type | Default | Description |
|---|---|---|---|
value | number | The integer value of the EnumItem to look up in this enum. |