Roblox UtilitiesDevlHub Roblox Documentation

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#

GetEnumItemsReturns an array of all EnumItem options available for this enum.
FromNameConverts an enum name to an Enum.
FromValueConverts 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 all EnumItem values belonging to this enum.

FromName(name: string): Enum | nil#

Returns either the converted Enum or nil.

NameTypeDefaultDescription
namestringThe name of the EnumItem to look up in this enum.
Returns
  • Enum | nil — The EnumItem whose Name matches the given string, or nil if no match exists.

FromValue(value: number): Enum | nil#

Returns either the converted Enum or nil.

NameTypeDefaultDescription
valuenumberThe integer value of the EnumItem to look up in this enum.
Returns
  • Enum | nil — The EnumItem whose integer value matches the given number, or nil if no match exists.