iiv03 Posted August 16, 2018 Posted August 16, 2018 I have designed the GUI drawing panel and open the button and want to do the dx panel with the gui panel which I just programming. I want a script that makes the DX panel open with a ( GUI panel! By Me )?
JeViCo Posted August 16, 2018 Posted August 16, 2018 local key = "f1" function menu() -- dx drawing stuff end bindKey(key,"down",function() if not menuVisible then addEventHandler("onClientRender",getRootElement(),menu) -- guiCreate stuff menuVisible = true else removeEventHandler("onClientRender",getRootElement(),menu) -- destroyElement(gui element) stuff menuVisible = nil end end)
Discord Moderators Pirulax Posted August 16, 2018 Discord Moderators Posted August 16, 2018 local isMenuVisible = false function menu() -- dx drawing stuff end bindKey("f1","down",function() isMenuVisible = not isMenuVisible -- Flip the state(if it's was true now it's false, and vice versa) ((isMenuVisible and addEventHandler) or (removeEventHandler))("onClientRender", root, menu) if menuVisible then --// Do some stuff here if you want else --// or here end end)
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