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?";
x = 509;
y = 203;
new GuiButtonCtrl("Buy_Button1") {
profile = GuiBlueButtonProfile;
text = "Buy Item";
width = 80;
x = 118;
y = 133;
}
new GuiTextCtrl("Buy_Text1") {
profile = GuiBlueTextProfile;
height = 20;
width = 8;
x = 143;
y = 9;
}
new GuiTextCtrl("Buy_Text2") {
profile = GuiBlueTextProfile;
height = 20;
text = "Would you like to buy?";
width = 108;
x = 106;
y = 35;
}
new GuiTextCtrl("Buy_Text3") {
profile = GuiBlueTextProfile;
height = 20;
text = thiso.item;
width = 39;
x = 135;
y = 51;
}
new GuiTextCtrl("Buy_Text4") {
profile = GuiBlueTextProfile;
height = 20;
text = "For...";
width = 25;
x = 145;
y = 66;
}
new GuiTextCtrl("Buy_Text5") {
profile = GuiBlueTextProfile;
height = 20;
text = thiso.price;
width = 44;
x = 132;
y = 86;
}
new GuiButtonCtrl("Buy_Button2") {
profile = GuiBlueButtonProfile;
text = "No thank you.";
width = 80;
x = 118;
y = 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";
x = 853;
y = 88;
new GuiTextCtrl("Buy_Text6") {
profile = GuiBlueTextProfile;
height = 20;
text = "Item:";
width = 22;
x = 140;
y = 24;
}
new GuiTextCtrl("Buy_Text7") {
profile = GuiBlueTextProfile;
height = 20;
text = thiso.item;
width = 39;
x = 131;
y = 44;
}
new GuiTextCtrl("Buy_Text8") {
profile = GuiBlueTextProfile;
height = 20;
text = "Receipt";
width = 36;
x = 134;
}
new GuiTextCtrl("Buy_Text9") {
profile = GuiBlueTextProfile;
height = 20;
text = "Price:";
width = 27;
x = 135;
y = 70;
}
new GuiTextCtrl("Buy_Text10") {
profile = GuiBlueTextProfile;
height = 20;
text = thiso.price;
width = 44;
x = 126;
y = 92;
}
new GuiButtonCtrl("Buy_Button3") {
profile = GuiBlueButtonProfile;
height = 22;
text = "Take My Item, I agree that I bought this item!";
width = 320;
y = 184;
}
new GuiTextCtrl("Buy_Text11") {
profile = GuiBlueTextProfile;
height = 20;
text = "Weapon Name:";
width = 73;
x = 115;
y = 114;
}
new GuiTextCtrl("Buy_Text12") {
profile = GuiBlueTextProfile;
height = 20;
text = thiso.weapon;
width = 200;
x = 122;
y = 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