Jump to content

[HELP] Button


Eweest

Recommended Posts

Hi guys! Such question. How to make so that when you press the button opened another window

There is an example:

function drawWindowAndButton() 
    window_1 = guiCreateWindow(x, y, w, h, "WINDOW 1", false)--Create window 1(Were button is) 
    window_2 = guiCreateWindow(x, y, w, h, "WINDOW 2", false)--Create window 2(The window to show after click) 
    guiSetVisible(window_2, false)--Make window 2 invisible!So we can make is visible later. 
    button = guiCreateButton(x, y, w, h, "SHOW WINDOW 2", false, window_1)--Create the button! 
end 
addEventHandler("onClientResourceStart", resourceRoot, drawWindowAndButton) 
  
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()),  
function() 
    if (source == button) then 
        guiSetVisible(window_2, true) --Now make window 2 visible! 
    end 
end) 

Link to comment
Hi guys! Such question. How to make so that when you press the button opened another window

There is an example:

function drawWindowAndButton() 
    window_1 = guiCreateWindow(x, y, w, h, "WINDOW 1", false)--Create window 1(Were button is) 
    window_2 = guiCreateWindow(x, y, w, h, "WINDOW 2", false)--Create window 2(The window to show after click) 
    guiSetVisible(window_2, false)--Make window 2 invisible!So we can make is visible later. 
    button = guiCreateButton(x, y, w, h, "SHOW WINDOW 2", false, window_1)--Create the button! 
end 
addEventHandler("onClientResourceStart", resourceRoot, drawWindowAndButton) 
  
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()),  
function() 
    if (source == button) then 
        guiSetVisible(window_2, true) --Now make window 2 visible! 
    end 
end) 

Thank you. I figured out

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