EnumItem

Constructors

NameDescription
Enum.<EnumName>.<ItemName> (e.g. Enum.Material.Wood)EnumItem has no direct new() constructor. Instances are obtained by indexing an Enum by item name, or by calling FromName() / FromValue() on the parent Enum.

Code Snippet

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
    local key = input.KeyCode -- an EnumItem

    if key == Enum.KeyCode.Space then
        print(key.Name, key.Value, key.EnumType)
    end
end)

Properties

NameTypeDescription
NamestringThe name of the EnumItem.
ValuenumberThe integral value assigned to the EnumItem.
EnumTypeEnumA reference to the parent Enum that this EnumItem belongs to.