This bug occurs at some point every time I try to seriously use UserInputService in any of my projects. It breaks my scripts, resulting in non-functionality and ruining my game. There is no way around it and it even breaks roblox’s CoreScripts.
Here’s my code:
ReplicatedStorage.Mouse lines 42, 43, 44
uis.InputBegan:connect(function(input)
if input.KeyCode == mouse.ChatKey and mouse.Chatting == false and mouse.AutoChatDetectionEnabled then
mouse.Chatting = true
UIS.InputEnded:connect(function(input)
if input.KeyCode.Name == 'Slash' then
if Mouse.Chatting == false then
It would appear that simply accessing the KeyCode property invokes this error, though the occurrence of the invalid enum seems to be random as I can’t reliably repro the behavior. Please fix this ASAP.
I’m using a Razer Blackwidow and I haven’t changed it from factory settings. After some more testing it appears that the error occurs when you press the menu key and then click back inside of the window.
Ok cool, this is what I thought might happen. I’m making sure all enum values are now bound to lua, so its impossible to get this error. It does mean there will be some sort of odd values exposed, but no more crashing.