manve1 Posted September 5, 2012 Posted September 5, 2012 sorry guy's but i forgot how to make on same button it shows something, once clicked the same button again it closes it function open() if (source == start_button) then test = guiCreateStaticImage( 0, 0.41, 0.3, 0.55, "pictures/8.png", true, gui ) end end addEventHandler("onClientGUIClick", start_button, open) If you help me, thank you
TAPL Posted September 5, 2012 Posted September 5, 2012 Maybe? function open() if (source == start_button) then if not test then test = guiCreateStaticImage(0, 0.41, 0.3, 0.55, "pictures/8.png", true, gui) else guiSetVisible(test, not guiGetVisible(test)) end end end addEventHandler("onClientGUIClick", start_button, open, false)
TwiX! Posted September 5, 2012 Posted September 5, 2012 function open() if (source == start_button) then test = guiCreateStaticImage( 0, 0.41, 0.3, 0.55, "pictures/8.png", true, gui ) elseif (source == stop_button) then if test then destroyElement(test) end end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), open)
manve1 Posted September 5, 2012 Author Posted September 5, 2012 TwiX thank you for a try. Ty to TAPL it worked bro, ty
TwiX! Posted September 5, 2012 Posted September 5, 2012 my code working too but it's destroy image. and create again + you need make stop_button then code will work
TAPL Posted September 5, 2012 Posted September 5, 2012 my code working toobut it's destroy image. and create again + you need make stop_button then code will work sorry guy's but i forgot how to make on same button it shows something, once clicked the same button again
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