1 min read

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

NameType / ReturnsDescription
Enum:GetEnumItemsArrayReturns an array of all EnumItem options available for this enum.
Enum:FromNameEnum | nilConverts an enum name to an Enum.
Enum:FromValueEnum | nilConverts an enum value to an Enum.

Enum:GetEnumItems

Returns an array of all the EnumItem options available for this enum.

Returns

TypeDescription
ArrayAn array of all EnumItem values belonging to this enum.

Enum:FromName

Returns either the converted Enum or nil.

Parameters

NameTypeDefaultDescription
namestringThe name of the EnumItem to look up in this enum.

Returns

TypeDescription
Enum | nilThe EnumItem whose Name matches the given string, or nil if no match exists.

Enum:FromValue

Returns either the converted Enum or nil.

Parameters

NameTypeDefaultDescription
valuenumberThe integer value of the EnumItem to look up in this enum.

Returns

TypeDescription
Enum | nilThe EnumItem whose integer value matches the given number, or nil if no match exists.