Adissonboy11 Posted July 19, 2015 Share Posted July 19, 2015 I got an error and doubt. The window does not open, and I need that when the box is checked, the chatbox disappear. Help-me local checkbox = {} local window = {} local button = {} local label = {} panel.window[1] = guiCreateWindow(31, 179, 251, 307, "15", false) guiWindowSetMovable(panel.window[1], false) guiWindowSetSizable(panel.window[1], false) guiSetAlpha(panel.window[1], 0.78) panel.checkbox[1] = guiCreateCheckBox(96, 70, 15, 15, "", false, false, panel.window[1]) panel.label[1] = guiCreateLabel(120, 68, 78, 19, "CHATBOX", false, panel.window[1]) function showpanel(key,keyState) if getElementData(getLocalPlayer(),"logedin") then if ( keyState == "down" ) then guiSetVisible(panel.window[1],not guiGetVisible(panel.window[1])) showCursor(not isCursorShowing()) if guiGetVisible(panel.window[1]) == true then onClientOpenpanelStopMenu () else hidepanel () end end end end bindKey ( "o", "down", showpanel ) function showpanelManual () guiSetVisible(panel.window[1],not guiGetVisible(panel.window[1])) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(panel.window[1]) == true then onClientOpenpanelStopMenu () end end function hidepanelManual () guiSetVisible(panel.window[1],false) showCursor(false) hidepanel () end addEvent("hidepanelManual",true) addEventHandler("hidepanelManual",getLocalPlayer(),hidepanelManual) function onClientOpenpanelStopMenu () triggerEvent("disableMenu",getLocalPlayer()) end function hidepanel () guiSetVisible(rightclickWindow,false) end Link to comment
DNL291 Posted July 20, 2015 Share Posted July 20, 2015 Try this: local checkbox = {} local window = {} local button = {} local label = {} window[1] = guiCreateWindow(31, 179, 251, 307, "15", false) guiWindowSetMovable(window[1], false) guiWindowSetSizable(window[1], false) guiSetAlpha(window[1], 0.78) guiSetVisible(window[1], false) checkbox[1] = guiCreateCheckBox(96, 70, 15, 15, "", false, false, window[1]) panel.label[1] = guiCreateLabel(120, 68, 78, 19, "CHATBOX", false, window[1]) addEventHandler( "onClientGUIClick", checkbox[1], function() showChat( not guiCheckBoxGetSelected(source) ) end, false ) function showpanel(key,keyState) if getElementData(getLocalPlayer(),"logedin") then if ( keyState == "down" ) then guiSetVisible(window[1],not guiGetVisible(window[1])) showCursor(not isCursorShowing()) if guiGetVisible(window[1]) == true then onClientOpenpanelStopMenu () else hidepanel () end end end end bindKey ( "o", "down", showpanel ) function showpanelManual () guiSetVisible(window[1],not guiGetVisible(window[1])) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(window[1]) == true then onClientOpenpanelStopMenu () end end function hidepanelManual () guiSetVisible(window[1],false) showCursor(false) hidepanel () end addEvent("hidepanelManual",true) addEventHandler("hidepanelManual",getLocalPlayer(),hidepanelManual) function onClientOpenpanelStopMenu () triggerEvent("disableMenu",getLocalPlayer()) end function hidepanel () guiSetVisible(rightclickWindow,false) end 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