You should be creating the GUI, then just toggling it's visibility like so:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
showGUI();
}
function showGUI() {
// Check if the Window has been made.
if (isObject("Test")) {
// Toggle Visibility
Test.visible = !Test.visible;
// Exit Script
return;
}
// Create GUI
new GuiWindowCtrl("Test") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "320,240";
canmove = true;
canresize = true;
closequery = false;
destroyonhide = false;
text = "Window 1";
x = 666;
y = 351;
}
// Sets Focus to Graal
GraalControl.makefirstresponder(true);
}