Jump to content
  • 0

Script @cart


Motoharo

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   1
  • Joined:  05/18/19
  • Last Seen:  

Could someone help me create an NPC that uses the @cart command for the player to choose between the 1 ~ 12 appearance of the carts?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  429
  • Reputation:   163
  • Joined:  12/12/17
  • Last Seen:  

Or you can enable the use of @cart to players instead

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   1
  • Joined:  05/18/19
  • Last Seen:  

10 hours ago, pajodex said:

Or you can enable the use of @cart to players instead

Yes, but I want to choose a cost

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  429
  • Reputation:   163
  • Joined:  12/12/17
  • Last Seen:  

// Note: the character needs to have the skill MC_PUSHCART to gain a cart
prontera,149,180,0	script	Cart Select	100,{
	// zeny cost of cart.
	setarray .@cart_cost[1],
		100, // cart 1
		200,
		300,
		400,
		500,
		600,
		700,
		800,
		900,
		1000,
		1100,
		1200; // cart 12
	if (!checkcart()) {
		mes "You must have a cart.";
		close;
	}
	mes "Choose a cart:";
	next;
	.@menu$ = "";
	for (.@i=1; .@i<13; .@i++) {
		.@menu$ += "Cart #"+.@i;
		.@menu$ += ":";
	}
	.@s = select(.@menu$);
	mes "You selected Cart #"+ .@s;
	mes " ";
	mes "Cost price is "+ F_InsertComma(.@cart_cost[.@s]) +"z.";
	next;
	if(select("Yes","No")==2) close;
	if (Zeny < .@cart_cost[.@s]) {
		mes "Not enough zeny,";
		close;
	}
	Zeny -= .@cart_cost[.@s];
	setcart .@s;
	mes "Goodluck!";
	close;
}

 

Link to comment
Share on other sites

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.

×
×
  • Create New...