Karuzo Posted January 10, 2014 Share Posted January 10, 2014 So i want to open my DX Cheat-Panel , i've made an if opened == false then , but if i want to open the panel i have to press twice to open it if i open it first. After the first opening i just have to press once to open it... function open() if opened == false then opened = true addEventHandler("onClientRender", getRootElement(), Panel) showCursor(true) guiSetVisible(Cheatbutton1, true) guiSetVisible(Cheatbutton2, true) guiSetVisible(Cheatbutton3, true) guiSetVisible(Cheatbutton4, true) else opened = false guiSetVisible(Cheatbutton1, false) guiSetVisible(Cheatbutton2, false) guiSetVisible(Cheatbutton3, false) guiSetVisible(Cheatbutton4, false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), Panel) end end bindKey("F7","down",open) Link to comment
Gallardo9944 Posted January 10, 2014 Share Posted January 10, 2014 function open() opened = not opened if opened == true then addEventHandler("onClientRender", getRootElement(), Panel) showCursor(true) guiSetVisible(Cheatbutton1, true) guiSetVisible(Cheatbutton2, true) guiSetVisible(Cheatbutton3, true) guiSetVisible(Cheatbutton4, true) else guiSetVisible(Cheatbutton1, false) guiSetVisible(Cheatbutton2, false) guiSetVisible(Cheatbutton3, false) guiSetVisible(Cheatbutton4, false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), Panel) end end bindKey("F7","down",open) Link to comment
Karuzo Posted January 10, 2014 Author Share Posted January 10, 2014 Thank you! #close Link to comment
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