aterhot Posted March 15, 2014 Share Posted March 15, 2014 how to view and hide a panel with bindKey? Link to comment
HerculePoirot Posted March 15, 2014 Share Posted March 15, 2014 function guiOpen() if (guiGetVisible(YOURGUI) == true) then --Check whether gui is visible or not guiSetVisible(YOURGUI, false) --if visible then close it else guiSetVisible(YOURGUI, true) --if not open it end end bindKey("F2", "down", guiOpen) --bind F2 for that function Replace YOURGUI with your gui. This is a client side script. Link to comment
aterhot Posted March 15, 2014 Author Share Posted March 15, 2014 thanks I'm new to this and still am somewhat noob Link to comment
Anubhav Posted March 15, 2014 Share Posted March 15, 2014 function guiOpen() if (guiGetVisible(YOURGUI) == true) then --Check whether gui is visible or not guiSetVisible(YOURGUI, false) --if visible then close it showCursor(false) else guiSetVisible(YOURGUI, true) --if not open it showCursor(true) end end bindKey("F2", "down", guiOpen) --bind F2 for that function Maybe this is better. He din't added the cursor which is important. Link to comment
cheez3d Posted March 15, 2014 Share Posted March 15, 2014 local window = guiCreateWindow(0,0,600,350,"bindKey Test",false) local showWindow = function() guiSetVisible(window,not guiGetVisible(window)) showCursor(not isCursorShowing()) end bindKey("p","down",showWindow) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now