TheSmart Posted September 20, 2015 Posted September 20, 2015 Hello Guys! today i was creating Dx Help Panel but it have problem that is when i press f1 dxpanel show up but when i press f1 again it wont remove Tell me why there is any problem in this code? function open() if (guiGetVisible (buttons) == false) then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) elseif (guiGetVisible (buttons) == true) then guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) end end bindKey ("F1", "down", open)
The Don Posted September 20, 2015 Posted September 20, 2015 function open() if (guiGetVisible (buttons) == false) then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) else guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) end end bindKey ("F1", "down", open)
KariiiM Posted September 20, 2015 Posted September 20, 2015 function open() if (guiGetVisible (buttons) == false) then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) else guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) end end bindKey ("F1", "down", open)
The Don Posted September 20, 2015 Posted September 20, 2015 hmmm try this windowstate = true bindKey("F1","down", function () if windowstate == true then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) windowstate = false else guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) windowstate = true end end )
TheSmart Posted September 20, 2015 Author Posted September 20, 2015 function open() if (guiGetVisible (buttons) == false) then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) else guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) end end bindKey ("F1", "down", open) what you change?...Nothing, Not working D:
TheSmart Posted September 20, 2015 Author Posted September 20, 2015 (edited) hmmm try this windowstate = true bindKey("F1","down", function () if windowstate == true then guiSetVisible(buttons, true) addEventHandler("onClientRender", root, dxPanel) showCursor(true) windowstate = false else guiSetVisible(buttons, false) removeEventHandler("onClientRender", root, dxPanel) showCursor(false) windowstate = true end end ) Thank you @Don its working now Edited September 20, 2015 by Guest
KariiiM Posted September 20, 2015 Posted September 20, 2015 what you change?...Nothing, Not working D: We just posted the same post together in same time,
LabiVila Posted September 21, 2015 Posted September 21, 2015 Another cool way of doing that is this: bindKey ("F1", "down", function () windowstate = not windowstate if windowstate then guiSetVisible (buttons, true) addEventHandler ("onClientRender", root, dxPanel) showCursor (true) else guiSetVisible (buttons, true) removeEventHandler ("onClientRender", root, dxPanel) showCursor (false) end end ) you don't have to declare much variables or stuff, and you might as well want to use guiSetInputEnabled (true), as it won't output to chatbox things you write in your dxPanel
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