Hello guys,
I tried to bind escape to my function in 2 ways. (the function is working tried with other buttons) The first was bindKey but when I use it its not binding escape but all other buttons. When I use the event onClientKey escape is working but not correctly. When I press it the first time its working but when I press it the second time its not working. (so its not working when the player is in the menu) (btw its a AFK system I made)
this way is not working:
bindKey ( "escape", "down", function )
this was isnt working correctly (this is what I found on wiki: Note: the escape key can only be cancelled once. If a user presses the escape key twice in a row the main menu will still open. ):
function pressDown (button, press)
if button == "escape" then
if press then -- when the button is pressed down (true)
function()
end
end
end
addEventHandler ("onClientKey", root, pressDown)
Guys I hope you can help me with that