SolvedCoding

Posts 1–7 of 7 · Page 1 of 1
Coding
I'm not sure how this would work, I'm kinda a huge noob at lua, Thank you in advance. <3
(Sorry if this is in the wrong forum)
Code:
if input.IsKeyDown(Speed_Key) then
AddKeyBind( Misc, 45, 125, "Speed_Key" )
Quote Originally Posted by tacoman452 View Post
I'm not sure how this would work, I'm kinda a huge noob at lua, Thank you in advance. <3
(Sorry if this is in the wrong forum)
Code:
if input.IsKeyDown(Speed_Key) then
AddKeyBind( Misc, 45, 125, "Speed_Key" )
Yes. That is exactly what the code is intended to do. feel free to ask anymore questions.
When i run that code i get an error
Code:
[ERROR] lua/includes/init.lua:34: bad argument #1 to 'IsKeyDown' (number expected, got nil)
  1. IsKeyDown - [C]:-1
   2. v - lua/includes/init.lua:34
    3. unknown - lua/includes/modules/hook.lua:84
Code:
if input.IsKeyDown(Speed_Key) then
AddKeyBind( Misc, 45, 125, "Speed_Key")
end
i did it for you
Code:
if (input::IsKeyDown(Speed_Key))
{
AddKeyBind(Misc, 45, 125, "Speed_Key");
}
I fixed the code for you,

make sure the IsKeyDown function is in the input namespace, ok gl hf.
hmmm, when i tried that i got this error
Code:
[ERROR] lua/includes/init.lua:34: ')' expected near '::'
- - - Updated - - -

Here is the entire code I'm running
Code:
require("amplify")
CreateClientConVar("N_Speed", 8, true, false)
local function Speed()
	if input.IsKeyDown(KEY_G) then
		amplify.Speed(GetConVarNumber("N_speed"))
else
		amplify.Speed(0)
	end
end
hook.Add("CreateMove", "Speed", Speed)
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us