Jump to content

DX Panel have to click twice to open.


Karuzo

Recommended Posts

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

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