Jump to content
  • 0

Shop Script


Question

Posted
new_1-1,44,103,5	script	Basic Weapons	100,{
   mes "select an item to buy";
   next;
   .@s = select( .menu$ ) -1;
   if ( countitem( .itemuse ) < .sellcost[.@s] ) {
       mes "not enough "+ getitemname( .itemuse );
       close;
   }
   delitem .itemuse, .sellcost[.@s];
   getitem2 .sellitem[.@s], 1,1,10,0, 0,0,0,0;
   close;
OnInit:
   setarray .sellitem, 28113, 1201, 1301;
   setarray .sellcost, 10, 20, 30;
   set .itemuse, 7929;
   .@size = getarraysize( .sellitem );
   for ( .@i = 0; .@i < .@size; .@i++ )
    .menu$ = .menu$ + getitemname( .sellitem[.@i] )+" +10 [Cost -> "+ .sellcost[.@i] +"]:";
   end;
}

Hi, can i request this script to buy using zeny.

I want it to change to instead of item, i can buy using zeny?

10 answers to this question

Recommended Posts

  • 0
Posted
-	script	Basic Weapons	-1,{
	mes "[ Basic Weapons ]";
	mes "What item do you wish to purchase?";
	next;
	.@s = select(.menu$) - 1;
	if(Zeny < .zeny[.@s]){
		mes "[ Basic Weapons ]";
		mes "You don't have enough zeny.";
		close;
	}
	Zeny -= .zeny[.@s];
	getitem2 .sellitem[.@s],1,1,10,0,0,0,0,0;
	close;
OnInit:
	setarray .sellitem, 28113,1201,1301;
	setarray .zeny, 1,2,3;
	for(.@i = 0; .@i < getarraysize(.sellitem); .@i++)
		.menu$ = .menu$ + getitemname(.sellitem[.@i])+" +10 [Cost -> "+.zeny[.@i]+"]:";
end;
}

Untested.

  • Upvote 1
  • 0
Posted
4 minutes ago, Moooooon-Aisha said:

-	script	Basic Weapons	-1,{
	mes "[ Basic Weapons ]";
	mes "What item do you wish to purchase?";
	next;
	.@s = select(.menu$) - 1;
	if(Zeny < .zeny[.@s]){
		mes "[ Basic Weapons ]";
		mes "You don't have enough zeny.";
		close;
	}
	Zeny -= .zeny[.@s];
	getitem2 .sellitem[.@s],1,1,10,0,0,0,0,0;
	close;
OnInit:
	setarray .sellitem, 28113,1201,1301;
	setarray .zeny, 1,2,3;
	for(.@i = 0; .@i < getarraysize(.sellitem); .@i++)
		.menu$ = .menu$ + getitemname(.sellitem[.@i])+" +10 [Cost -> "+.zeny[.@i]+"]:";
end;
}

Untested.

Hi where's the NPC coor?

  • 0
Posted

I will replace this 

-	script	Basic Weapons	-1,{

to

new_1-1,44,103,5	script	Basic Weapons	100,{

?

Lol, I'm just make sure. Because, he changed my script to that. I'm curious. lol. 

  • 0
Posted (edited)
<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}

^ why not use that?

Edited by Mabuhay
  • Love 1
  • 0
Posted
1 minute ago, Mabuhay said:

<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}

^ why not use that?

my script if you buy the item it has automatic refine to +10

  • 0
Posted
4 minutes ago, Ryo Osaki said:

I will replace this 


-	script	Basic Weapons	-1,{

to

 


new_1-1,44,103,5	script	Basic Weapons	100,{

?

just duplicate the npc

prontera,150,150,4	duplicate(Basic Weapons)	Basic Weapons#prt	4_DOG01

 

  • 0
Posted
4 hours ago, Mabuhay said:

ahh i see, didnt read the script. My bad.

Yes, its okay. Thanks.

4 hours ago, Bringer said:

just duplicate the npc


prontera,150,150,4	duplicate(Basic Weapons)	Basic Weapons#prt	4_DOG01

 

I already done and fixed it. I'm just asking why did he changed the header. Hmm. ?

By the way, thanks @Moooooon-Aisha

  • 0
Posted

please stay cool and don't go off-topic

stay on the topic or we would be forced to lock this post

if you found your answer , please mark it as an answer and if you have another question , open a new topic with that question

if it's a personal question , you can ask the person in the private messages if he agree to contact you (i am talking about all who are moving off-topic)

  • Upvote 1
  • Love 2
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...