Jump to content

[Help] GUI and bindKey


aterhot

Recommended Posts

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

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