According to the documentation (Enum | Documentation - Roblox Creator Hub), FromValue is a method of Enums, so there is no reason for this error to happen. I expect the function FromValue to be found and executed.
This seems like a new function. I know for a fact that both FromName and FromValue did not exist before because I and a friend needed to work-around it not existing with our own solution. Is it possible that this simply hasn’t rolled out fully yet to the client? Still problematic even if so and it should at the minimum be communicated if so, but I’m wondering if that could be the reason for it?
I remember implementing the use of FromValue in a testing game some months ago, so I am quite surprised if this isn’t yet rolled out on all clients now. I haven’t seen any announcement or communication, or warning about it, so I just assume it to work no matter what.
Hello homermafia1, this bug makes no sense at all and is clearly a Roblox error itself, probably caused because something related to the client’s resources may not have been loaded completely, so I suggest you use this updated version I made that will only continue the code once it is successfully completed.
local keycode_values = {}
local function GetValues()
local Sucess, Error = pcall(function()
for i = 160, 254 do
table.insert(keycode_values, Enum.KeyCode:FromValue(i))
end
end)
return Sucess, Error
end
while task.wait() do
local Sucess, Error = GetValues()
if not Sucess then
warn(Error)
keycode_values = {}
else
break
end
end
We’ve attempted to reproduce the issue without success. We are closing the thread for now, but please share any additional information or steps that could be valuable for us to re-open the investigation.