Hey, I am fairly new to lua and have a problem with the input.IsKeyDown() function.
No matter how I use it
hook.Add( "Think", "keypress_test", function() if input.IsKeyDown( KEY_SPACE ) then print("You pressed space") end end )
I always get the same error:
[ERROR] lua/test.lua:2: attempt to index global ‘input’ (a nil value)
- v - lua/test.lua:2
- unknown - lua/includes/modules/hook.lua:84
I understand what this means, it simply states that “input” is not defined, which doesn’t make any sense… I just haven’t seemed to figure this out, or see anyone with the same problem. Thanks if you can help!
Again, I know this is simple stuff, I literally started programming in lua today