EnumItem
Summary
Properties
Name
stringThe name of the
EnumItem.
Value
NumberThe integral value assigned to the
EnumItem.
EnumType
EnumA reference to the parent
Enumof theEnumItem.
Example
Enum items are named values. Compare the item itself in game logic, and use its properties when displaying or inspecting it:
local key = Enum.KeyCode.R
print(key.Name) -- Rprint(key.Value) -- 114 in Vortex Studio 0.3.8print(key.EnumType) -- Enum.KeyCode
if key == Enum.KeyCode.R then print("The values match")endAvoid depending on a numeric Value when an enum item is available. The named
item is clearer and does not require the number to remain unchanged.