View Single Post
  #9  
Old 02-23-2011, 01:01 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
New Script Still Needs help, now it doesnt view the gui, and it hides on clicked. Nothing happens... I need major help...

Class:
PHP Code:
function onActionServerSide(cmd)
{
if (
cmd == "buy")
{
player.rupees -= thiso.price;
addweapon(thiso.weapon);
}
}
//#CLIENTSIDE
function onActionLeftMouse() {
Buy_Window1.show();
  new 
GuiWindowCtrl("Buy_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";

    
canclose false;
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Buy This Item?";
    
509;
    
203;

    new 
GuiButtonCtrl("Buy_Button1") {
      
profile GuiBlueButtonProfile;
      
text "Buy Item";
      
width 80;
      
118;
      
133;
    }
    new 
GuiTextCtrl("Buy_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
width 8;
      
143;
      
9;
    }
    new 
GuiTextCtrl("Buy_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Would you like to buy?";
      
width 108;
      
106;
      
35;
    }
    new 
GuiTextCtrl("Buy_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text thiso.item;
      
width 39;
      
135;
      
51;
    }
    new 
GuiTextCtrl("Buy_Text4") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "For...";
      
width 25;
      
145;
      
66;
    }
    new 
GuiTextCtrl("Buy_Text5") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text thiso.price;
      
width 44;
      
132;
      
86;
    }
    new 
GuiButtonCtrl("Buy_Button2") {
      
profile GuiBlueButtonProfile;
      
text "No thank you.";
      
width 80;
      
118;
      
185;
    }
  }
  new 
GuiWindowCtrl("Buy_Window2") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,206";
    
canclose false;
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Receipt";
    
853;
    
88;

    new 
GuiTextCtrl("Buy_Text6") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Item:";
      
width 22;
      
140;
      
24;
    }
    new 
GuiTextCtrl("Buy_Text7") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text thiso.item;
      
width 39;
      
131;
      
44;
    }
    new 
GuiTextCtrl("Buy_Text8") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Receipt";
      
width 36;
      
134;
    }
    new 
GuiTextCtrl("Buy_Text9") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Price:";
      
width 27;
      
135;
      
70;
    }
    new 
GuiTextCtrl("Buy_Text10") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text thiso.price;
      
width 44;
      
126;
      
92;
    }
    new 
GuiButtonCtrl("Buy_Button3") {
      
profile GuiBlueButtonProfile;
      
height 22;
      
text "Take My Item, I agree that I bought this item!";
      
width 320;
      
184;
    }
    new 
GuiTextCtrl("Buy_Text11") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Weapon Name:";
      
width 73;
      
115;
      
114;
    }
    new 
GuiTextCtrl("Buy_Text12") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text thiso.weapon;
      
width 200;
      
122;
      
141;
    }
    
Buy_Window2.hide();
  }
}

function 
Buy_Button1.onAction() {
  
Buy_Window1.hide();
  
Buy_Window2.show();
}

function 
Buy_Button2.onAction() {
  
Buy_Window1.hide();
}

function 
Buy_Button3.onAction() {
  
Buy_Window2.hide();
  
triggerserver("gui",thiso.name,"buy");
  
player.chat "Bought "@thiso.item@"!";

(deleted the public function buy2)...

NPC:
PHP Code:
join("object_buy");
//#CLIENTSIDE
function onCreated()
  {
  
thiso.item "Ghost";
  
thiso.price "2500";
  
thiso.weapon "Morphs/Ghost";

Help... :o
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote