Example:
Enum.KeyCode.One has as enum value: 49
How do i get this value when i have the enum?
This way i can write the following code which is a lot shorter than the alternative
local function manageInventory(input, gameProcessed) local key = input.KeyCode - 48 if 0 < key and key < 7 then if inventory["ViewportFrame"..key].BorderColor3 == unactiveColor then unselectAll() inventory["ViewportFrame"..key].BorderColor3 = activeColor else inventory["ViewportFrame"..key].BorderColor3 = unactiveColor end end end
For any enum with a value, you just have to index the Value from the enum, in your specific case it would be like this
Enum.KeyCode.One.Value