Class:
PHP Code:
//#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 = this.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 = this.price;
width = 44;
x = 132;
y = 86;
}
new GuiButtonCtrl("Buy_Button2") {
profile = GuiBlueButtonProfile;
text = "No thank you.";
width = 80;
x = 118;
y = 185;
}
}
Buy_Window2.hide();
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 = this.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 = this.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 = this.weapon;
width = 60;
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();
buy2(this.weapon, this.price, this.item);
}
The public function buy2
PHP Code:
public function buy2(a, b, c)
{
a = temp.weapon;
b = temp.price;
c = temp.name;
player.rupees -= temp.price;
addweapon(temp.weapon);
player.chat = "I bought a "@temp.name@"! For "@temp.price@"!";
}
The NPC
PHP Code:
join("object_buy");
//#CLIENTSIDE
function onCreated()
{
this.item = "Ghost";
this.price = "2500";
this.weapon = "Morphs/Ghost";
}
What I need help with?
Whenever I use the system this.item, this.price, and this.weapon ALWAYS = 0 in the actual GUI when you use it! Now I dont really know how to get that to say the NPCs variables, please help!