IceBrasill Posted November 5, 2014 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
Dealman Posted November 5, 2014 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);
IceBrasill Posted November 5, 2014 Author 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
Dealman Posted November 5, 2014 Posted November 5, 2014 Are you sure the image is being created? Does teleport.png exist?
Dealman Posted November 5, 2014 Posted November 5, 2014 Can't really help unless you show me your current code.
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