Use the same method Garry's Mod uses to detect key presses.
parent
3a809e213d
commit
efba83b6ed
|
@ -100,7 +100,7 @@ local function CreateMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add( "PlayerBindPress", "PlayerBindPressFKeyMenus", function(pl, bind, pressed)
|
hook.Add( "PlayerBindPress", "PlayerBindPressFKeyMenus", function(pl, bind, pressed)
|
||||||
if string.find(bind, "gm_showspare2") then
|
if bind == "gm_showspare2" and pressed then
|
||||||
local menu = CreateMenu()
|
local menu = CreateMenu()
|
||||||
if menu ~= nil then
|
if menu ~= nil then
|
||||||
menu:Open()
|
menu:Open()
|
||||||
|
|
Loading…
Reference in New Issue