• Can someone help me?
    3 replies, posted
[ERROR] addons/tttdamagelogs-3.1.0/lua/damagelogs/client/init.lua:172: bad argument #1 to 'IsKeyDown' (number expected, got nil)   1. IsKeyDown - [C]:-1    2. Think - addons/tttdamagelogs-3.1.0/lua/damagelogs/client/init.lua:172     3. fn - addons/tttdamagelogs-3.1.0/lua/damagelogs/client/init.lua:191      4. unknown - addons/ulib/lua/ulib/shared/hook.lua:109 I dont know what I am doing with this lua...
The issue is probably an invalid enum/undefined variable being sent into input.IsKeyDown. Posting some code around the error line would help.
input.IsKeyDown need a key as parameter, a parameter is what you put inside the ( ) A list of key can be found here : KEY Enumerations For exemple you could use if input.IsKeyDown( KEY_E ) then print("Hey, you pressed E !") end KEY_E is a 'constant' you can both use its name & numeric value, for exemple the numeric value of KEY_E is 15 as you can see in the WIKI, so you can use : if input.IsKeyDown( 15 ) then print("Hey, you pressed E !") end Good luck,
You should always use the constant variable - enum values can change between updates and using constant numbers will break support from that.
Sorry, you need to Log In to post a reply to this thread.