Jump to content

Forgot how :(


manve1

Recommended Posts

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

Link to comment

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) 

Link to comment
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) 

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