IceBrasill Posted November 5, 2014 Share Posted November 5, 2014 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
Dealman Posted November 5, 2014 Share Posted November 5, 2014 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
IceBrasill Posted November 5, 2014 Author Share Posted November 5, 2014 http://uploaddeimagens.com.br/images/000/391/517/full/mta-screen_2014-11-05_09-59-23.png?1415192472 /debugscript 3 Link to comment
Dealman Posted November 5, 2014 Share Posted November 5, 2014 Are you sure the image is being created? Does teleport.png exist? Link to comment
Dealman Posted November 5, 2014 Share Posted November 5, 2014 Can't really help unless you show me your current code. Link to comment
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