Jump to content

[Help] GUI and bindKey


aterhot

Recommended Posts

Posted
  
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.

Posted
  
  
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.

Posted
  
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) 
  

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...