Well it looks like you're trying to destroy the GUI and re-create it in the same function, which can cause Exception errors. To get around that I do:
PHP Code:
//#CLIENTSIDE
// Assumed Code Above
public function OpenWindow( data ){
if (isObject("Npc_Chat_Window1")) {
Npc_Chat_Window1.destroy();
}
this.mynpcid = temp.data;
this.textarray = false;
triggerServer("weapon", this.name, "getText", this.mynpcid, this.textarray);
// Have the GUI re-created a frame later.
this.scheduleevent(0.05, "CreateGUI", "");
}
function onCreateGUI() {
new GuiWindowCtrl("Npc_Chat_Window1") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "211,231";
useOwnProfile = true;
profile.bitmap = "guiarm_window.png";
canmove = true;
canresize = true;
closequery = false;
destroyonhide = true; // Will destroy the window when it's closed.
visible = true; // Will make sure the window is visible.
text = "Loading...";
x = 309;
y = 88;
new GuiScrollCtrl("Npc_Chat_MultiLine1_Scroll") {
profile = GuiBlueScrollProfile;
useOwnProfile = true;
profile.bitmap = "guiarm_scroll.png";
height = 130;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 150;
x = 46;
//y = 143;
new GuiMLTextCtrl("Npc_Chat_MultiLine1") {
profile = GuiBlueMLTextProfile;
height = 130;
//horizsizing = "width";
text = "Loading...";
width = 150;
}
}
new GuiScrollCtrl( "Npc_Chat_Scroll" ) {
this.width = 176;
this.height = 75;
profile.bitmap = "guiarm_scroll.png";
this.x = 19;
this.y = 143;
this.hScrollBar = "alwaysOff";
this.vScrollBar = "dynamic";
new GuiTextListCtrl( "Npc_Chat_ItemList" ) {
profile.bitmap = "guiarm_window.png";
this.width = 25;
this.height = 33;
}
}
new GuiShowImgCtrl("Npc_Chat_Image1") {
x = 9;
partx = 0;
party = 60;
partw = 50;
parth = 36;
width = 150;
height = 150;
image = "block.png";
}
}
}
I also set the booleans in destroyonhide to true and visible to true, as it may be related to your problem, but we'll see.