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

3 comments
I'm pretty sure you can't do that.
I'm pretty sure you can't get an Enum value into a Variable.
you can do it, see accepted answer.