How can you detect F12 functions, the normal GM:KeyPress doesn't detect keys like F12.
I've tried this code but it's not working
[LUA]
function GM:Think()
if (input.WasKeyPressed(KEY_F12)) then
if HUDToggled == true then
HUDToggled = false
else
HUDToggled = true
end
end
end
[/LUA]
Why wouldnt it? KEY_F12 is the enum for it.
[b][url=http://wiki.garrysmod.com/?title=Input.IsKeyDown]Input.IsKeyDown [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
I've tried that, is there a way to get it to only call once?
Set up a timer to change a boolean to true when it can be called, and false to when it cant be called. Dont have much time to write you up a little script, but basically use the
NextCheck = CurTime() + 1 method. It will make it so that it wont check again untill a seond later.
How exactly do I do that, When I tried before. It failed
Sorry, you need to Log In to post a reply to this thread.