Jump to content

[Helo] Window


IceBrasill

Recommended Posts

GUIEditor = { 
    button = {}, 
    staticimage = {}, 
} 
  
function openGui() 
        myWindow = guiCreateStaticImage(109, 53, 411, 267, "teleport.png", false) 
        GUIEditor.button[1] = guiCreateButton(23, 83, 80, 27, "Arena 1", false, myWindow)    
end 
  
function guiOpen() 
if (guiGetVisible(myWindow) == true) then  
guiSetVisible(myWindow, false)  
showCursor(false) 
else 
guiSetVisible(myWindow, true)  
showCursor(true) 
end 
end 
bindKey("F2", "down", guiOpen) 

Not open the window :/

Link to comment

Because the function openGui is never executed, thus, the GUI doesn't exist when you try to show it. Try this instead;

function openGui() 
    myWindow = guiCreateStaticImage(109, 53, 411, 267, "teleport.png", false);guiSetVisible(myWindow, false); -- Create the GUI when the resource is started, but hide it. 
    myButton = guiCreateButton(23, 83, 80, 27, "Arena 1", false, myWindow); 
end 
addEventHandler("onClientResourceStart", resourceRoot, openGui); 
  
function guiOpen() 
    if(guiGetVisible(myWindow) == false) then 
        guiSetVisible(myWindow, true); 
        showCursor(true); 
    else 
        guiSetVisible(myWindow, false); 
        showCursor(false); 
    end 
end 
bindKey("F2", "down", guiOpen); 

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