Jump to content

Why does this not work?


KraZ

Recommended Posts

Why doesn't this work i get something to do with a error on the line 48 saying '(' expected to close to ')'

  
function ViewGUI () --This is the line i get error on. 
    if ( guiGetVisible ( window ) == true ) then 
        showCursor(false) 
        guiSetVisible(window,false) 
    elseif ( guiGetVisible ( window ) == false ) then 
        showCursor(true) 
        guiSetVisible(window,true) 
    end 
end 
  
function binds () 
  bindKey ( "F1", "down", ViewGUI )   
end 
addCommandHandler ( "bindme", binds ) 
end 
  

Link to comment
  
function ViewGUI () --This is the line i get error on. 
    if ( guiGetVisible ( window ) == true ) then 
        showCursor(false) 
        guiSetVisible(window,false) 
    elseif ( guiGetVisible ( window ) == false ) then 
        showCursor(true) 
        guiSetVisible(window,true) 
    end 
end 
  
function binds () 
  bindKey ( "F1", "down", ViewGUI ) 
end 
addCommandHandler ( "bindme", binds ) 
  

Link to comment

You can also shorten the code to be:

  
function ViewGUI () 
    guiSetVisible (window,not guiGetVisible ( window ) ) 
    showCursor(guiGetVisible (window)) 
end 
  
function binds () 
  bindKey ( "F1", "down", ViewGUI ) 
end 
addCommandHandler ( "bindme", binds ) 
  

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