myWindow = guiCreateWindow ( 0, 0, .5, .5, "main", true )
button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "open", true,myWindow )
editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true,myWindow )
function outputEditBox ()
local text = guiGetText ( editBox )
outputChatBox ( text )
end
addEventHandler ( "onClientGUIClick", button, outputEditBox )
function guiToggleVisible ( )
if ( guiGetVisible ( myWindow ) == true ) then
guiSetVisible ( myWindow, false )
showCursor ( false )
guiSetInputEnabled( false )
else
guiSetVisible ( myWindow, true )
showCursor ( true )
guiSetInputEnabled ( true )
end
end
bindKey ( "f2", "down", guiToggleVisible )