Show Me

Your best/favorite NPC that you are willing to put up here. :slight_smile: Make sure if anyone else uses them, please give credit.

Re: Show Me

:cry:

Re: Show Me

I would post something but I just make things on the go, and am not particularily proud of 'em.

Re: Show Me

I vote your shop gui

Re: Show Me

Works for me.
I'll post my old one (New one is basically the same)

[code]//Beholder's Old ShopGUI [Sentinel]
//#CLIENTSIDE
if (playertouchsme) EnterShop();

function SetupShop() { // Allows up to 24 Items, which you must link to manually.
//setstring clientr.NPCshop_0,Weapons_Name,Weapon_Image,Price,x,y;
setstring clientr.NPCshop_0,S.Boots,sen_ico_sboots.png,900,13,7;
setstring clientr.NPCshop_1,Tools_Lantern,sen_ico_handlamp1.png,80,15,7;
}

function EnterShop() {
for(this.i = 0; this.i < this.itemcount; this.i++) setstring clientr.NPCshop_#v(this.i),;
timereverywhere;
SetupShop();
this.shopdata = {screenwidth - 150,screenheight/2-73,5};
for(this.itemcount = 0; this.itemcount < 24; this.itemcount++)
if(strequals(#s(clientr.NPCshop_#v(this.itemcount)),)) break;

this.shopselect = 0; this.buycancel = 1; this.shopping = true;
this.key0 = 1; this.key1 = 1; this.key2 = 1; this.key3 = 1; this.key4 = 1; this.key5 = 1;
disabledefmovement; setani sen_idle,;

DrawShop();

while (this.shopping == true) {
if(keydown(0)) { if(this.shopselect - 1 >= 0 && this.key0 == false) {this.shopselect–; play sen_select.wav; this.key0 = true;} } else this.key0 = false;
if(keydown(2)) { if(this.shopselect + 1 < this.shopdata[2] && this.key2 == false) {this.shopselect++; play sen_select.wav; this.key2 = true;} } else this.key2 = false;

if(keydown(1)) {
this.key3 = 0;
if(this.key1 == 0) {this.buycancel = 1; this.key1 = 1;}
} else if(keydown(3)) {
this.key1 = 0;
if(this.key3 == 0) {
this.key3 = 1;
this.buycancel = 0;
}
} else {this.key1 = 0; this.key3 = 0;}

if (keydown(6) || keydown(8) || keydown(9)) { this.shopping = false; play sen_cancel.wav;}
if (keydown(5) || keydown(4)) {
if(this.key5 == 0 && this.key4 == 0){
this.key5 = 1; this.key4 = 1;
if(this.buycancel == 1) { //BUYING
if(hasweapon(#t(0)) || playerrupees < strtofloat(#t(2))) play sen_wrong.wav;
else {
changeimgcolors 502+(this.shopselect%4)*4,0.8,0.8,0.8,1;
changeimgcolors 503+(this.shopselect%4)*4,0.8,0.8,0.8,1;

  for(this.npc = 0; this.npc < npcscount; this.npc++){//callnpc index,eventflag;
   if(npcs[this.npc].x == strtofloat(#t(3)) && npcs[this.npc].y == strtofloat(#t(4))){
    callnpc this.npc,actionGiveitem,#a,#t(2);
   }
  }

  for(this.i=0; this.i<3; this.i++) {play sen_gralatcont.wav; sleep 0.1;}
  play sen_gralat.wav;
 }
} else {this.shopping = false; play sen_cancel.wav;}

}
} else { this.key5 = 0; this.key4 = 0;}
for(this.k = 0; this.k <= 8; this.k++) if(keydown(this.k)){ DrawShop(); break;} //Passively Draw Shop
sleep 0.05;
}
for(this.i = 0; this.i < this.itemcount; this.i++) setstring clientr.NPCshop_#v(this.i),;
hideimgs 500,525;
enabledefmovement;
}

function DrawShop() {
for (this.item = 0; this.item < 4; this.item++;) {
tokenize #s(clientr.NPCshop_#v(this.item + int(this.shopselect/4)4));
showimg 500+this.item
4,sen_shopmenu_1.png,this.shopdata[0],this.shopdata[1]+this.item*33;

showimg 520,sen_shopmenu_1.png,this.shopdata[0]+108,this.shopdata[1]-10;
changeimgpart 520,110,64,9,9; changeimgvis 520,5;

if(!strequals(#t(0),)) {
showimg 501+this.item4,#I(clientr.NPCshop_#v(this.item + int(this.shopselect/4)4),1),this.shopdata[0],this.shopdata[1]+this.item33;
showtext 503+this.item
4,this.shopdata[0]+35,this.shopdata[1]+this.item33+16,arial,b,#I(clientr.NPCshop_#v(this.item + int(this.shopselect/4)4),2)g;
changeimgcolors 503+this.item
4,55/255,106/255,138/255,1; changeimgcolors 502+this.item
4,55/255,106/255,138/255,1;
if(hasweapon(#t(0))) { changeimgcolors 502+this.item4,0.8,0.8,0.8,1; changeimgcolors 503+this.item4,0.8,0.8,0.8,1;
} else if(playerrupees < strtofloat(#t(2)) && this.shopselect%4 == this.item) {changeimgcolors 503+this.item*4,0.9,0.2,0.3,1;}

tokenize2 ,#I(clientr.NPCshop#v(this.item + int(this.shopselect/4)4),0);
showtext 502+this.item
4,this.shopdata[0]+35,this.shopdata[1]+this.item*33,arial,b,#t(tokenscount - 1);

} else { hideimgs 501+this.item4,503+this.item4; }
if(this.shopselect % 4 == this.item) changeimgpart 500+this.item * 4,0,0,117,32;
else changeimgpart 500+this.item * 4,0,32,117,32;

changeimgvis 500+this.item * 4,5;
for(this.itemb = 1; this.itemb < 4; this.itemb++) {
changeimgvis 500+this.item4+this.itemb,6;
if(this.itemb > 1) changeimgzoom 500+this.item
4+this.itemb,0.65;
}
}

showimg 521,sen_shopmenu_1.png,this.shopdata[0]+118,this.shopdata[1]+(this.shopselect % 4)*33;
changeimgvis 521,5; if(!this.shopselect == 0) changeimgpart 521,88,64,11,15; else hideimg 521;
showimg 522,sen_shopmenu_1.png,this.shopdata[0]+118,this.shopdata[1]+(this.shopselect % 4)*33+17;
changeimgvis 522,5; if(!this.shopselect + 1 == this.itemcount) changeimgpart 522,88,79,11,15; else hideimg 522;

tokenize #s(clientr.NPCshop_#v(this.shopselect));
showimg 523,sen_shopmenu_1.png,this.shopdata[0]+26,this.shopdata[1]+133;
changeimgvis 523,5; if(hasweapon(#t(0)) || playerrupees < strtofloat(#t(2))) {changeimgpart 523,0,76,44,12;} else if(this.buycancel == 1) changeimgpart 523,0,64,44,12; else changeimgpart 523,0,76,44,12;
showimg 524,sen_shopmenu_1.png,this.shopdata[0]+71,this.shopdata[1]+133;
changeimgvis 524,5; if(this.buycancel == 0) changeimgpart 524,44,64,44,12; else changeimgpart 524,44,76,44,12;
}[/code]

NPCw

[code]if(actionGiveitem){
if(strequals(#a,#p(0))){
if(!hasweapon(Weapons_Boomerang)){
playerrupees -= strtofloat(#p(1));
toweapons Weapons_Boomerang;
}
}
}

//weapon script here
[/code]

Re: Show Me

Thanks Man, cool stuff!

So for the NpcW it must be on the level somewhere?

Re: Show Me

Course, No NPC Server = No addweapon weaponname;

Re: Show Me

Why’d you guys have to dump all the attached images? :’(

Haha

Looks familiar.