Jump to content

Script help


Recommended Posts

Alright, i got this stuff fixed up, yet i have a problem with my script, i have it showcursor and setinputenabled activated once script starts

 

addEventHandler ( "onClientGUIClick", Lobby.button[1], hideBoxes, false) 
addEventHandler ( "onClientGUIClick", Lobby.button[2], hideBoxes2, false) 
end 
showCursor(true) 
guiSetInputEnabled(false) 
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), createWindow ) 
function hideBoxes ( button, state ) 
    if button == "left" and state == "up" then 
                setElementDimension ( localPlayer, 0 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)         
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(true) 
    end 
end 
  
function hideBoxes2 ( button, state ) 
    if button == "left" and state == "up" then 
            setElementDimension( localPlayer, 1 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)     
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(true) 
    end 
end  

Yet, the cursor doesn't go away and it doesn't do guiSetInputEnabled(true) upon clicking a button, why is this?

Link to comment
Alright, i got this stuff fixed up, yet i have a problem with my script, i have it showcursor and setinputenabled activated once script starts

 

addEventHandler ( "onClientGUIClick", Lobby.button[1], hideBoxes, false) 
addEventHandler ( "onClientGUIClick", Lobby.button[2], hideBoxes2, false) 
end 
showCursor(true) 
guiSetInputEnabled(false) 
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), createWindow ) 
function hideBoxes ( button, state ) 
    if button == "left" and state == "up" then 
                setElementDimension ( localPlayer, 0 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)         
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(true) 
    end 
end 
  
function hideBoxes2 ( button, state ) 
    if button == "left" and state == "up" then 
            setElementDimension( localPlayer, 1 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)     
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(true) 
    end 
end  

Yet, the cursor doesn't go away and it doesn't do guiSetInputEnabled(true) upon clicking a button, why is this?

its no't full codes, i can't help you like this -.-

Link to comment

i am sure that guiSetInputEnabled must be true when the gui appears and false inside the function hideBoxes

guiSetInputEnabled ( false ) is the same as guiSetInputMode ( "allow_binds" )

guiSetInputEnabled ( true ) is the same as guiSetInputMode ( "no_binds" )

idk whats wrong with the cursor

addEventHandler ( "onClientGUIClick", Lobby.button[1], hideBoxes, false) 
addEventHandler ( "onClientGUIClick", Lobby.button[2], hideBoxes2, false) 
end 
showCursor(true) 
guiSetInputEnabled(true) -- there is a new function for this called guiSetInputMode, you can use that instead  
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), createWindow ) 
function hideBoxes ( button, state ) 
    if button == "left" and state == "up" then 
                setElementDimension ( localPlayer, 0 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)         
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(false) 
    end 
end 
  
function hideBoxes2 ( button, state ) 
    if button == "left" and state == "up" then 
            setElementDimension( localPlayer, 1 ) 
        guiSetEnabled(guiButtons, false) 
        guiSetEnabled(guiButtons1, false) 
    guiSetVisible(guiButtons, false)     
    guiSetVisible(guiButtons1, false) 
    showCursor(false) 
    guiSetInputEnabled(false) 
    end 
end  

and it would be helpful if u provided the full code

Edited by Guest
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...