Hand-written by Joseph San Nicolas, Roblox Developer
EnumItem
Constructors
| Name | Description |
| 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
| Name | Type | Description |
| Name | string | The name of the EnumItem. |
| Value | number | The integral value assigned to the EnumItem. |
| EnumType | Enum | A reference to the parent Enum that this EnumItem belongs to. |