Jump to content

GuiSetVisible not working...


Krons

Recommended Posts

Hello , i am working on a login panel but i cant make the gui to set visible on gui button is cliecked.No errors in debug

Here's the code

GUIEditor = {
    checkbox = {},
    staticimage = {},
    label = {},
    button = {},
    memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.button[1] = guiCreateButton(0.45, 0.71, 0.10, 0.03, "Play", false)


        GUIEditor.label[1] = guiCreateLabel(0.41, 0.68, 0.05, 0.03, "Save", false)


        GUIEditor.checkbox[1] = guiCreateCheckBox(0.39, 0.68, 0.01, 0.02, "", false, false)


        GUIEditor.memo[1] = guiCreateMemo(0.39, 0.64, 0.22, 0.03, "Password", false)


        GUIEditor.memo[2] = guiCreateMemo(0.39, 0.60, 0.22, 0.03, "Username", false)


        GUIEditor.staticimage[1] = guiCreateStaticImage(0.27, 0.40, 0.46, 0.15, ":guieditor/images/examples/KRONSLOGOGOOD.png", true)    
		
		GUIEditor.button[3] = guiCreateButton(0.2656, 0.5547, 0.10, 0.03, "Play", true)	

		guiSetAlpha ( GUIEditor.button[3], 1 )	
    end
)

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientGUIClick",root,function()
	if source == GUIEditor.button[3] then
		guiSetVisible(GUIEditor.button[1],true)
		guiSetVisible(GUIEditor.label[1],true)
		guiSetVisible(GUIEditor.checkbox[1],true)
		guiSetVisible(GUIEditor.memo[1],true)
		guiSetVisible(GUIEditor.memo[2],true)
	end
end)

 

Link to comment

Not sure if guiSetVisible works on other gui elements than windows. I recommend you to download guieditor and make the gui with that. Make sure to add the buttons etc into a window, and then change the window's visibility.

Alternatively you can just use guiSetAlpha but then you can click the buttons even when they are not visible but ofcourse you could add a check to see if the button alpha is not 0.

Edited by xyzii
Link to comment
48 minutes ago, xyzii said:

Not sure if guiSetVisible works on other gui elements than windows. I recommend you to download guieditor and make the gui with that. Make sure to add the buttons etc into a window, and then change the window's visibility.

Alternatively you can just use guiSetAlpha but then you can click the buttons even when they are not visible but ofcourse you could add a check to see if the button alpha is not 0.

Still not working , works only to set them false , but not to set them true ...

Well i fixed it by creating a function , adding gui elements into it and handling it onclientguiclicked , ty anyway for help.

Edited by Krons
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...