Jump to content
  • 0

Input amount on vote npc


Frost Diver

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  177
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

Hello!

I need a little help. How can i make this script to have an input option. Example, i got 30 vote points. And when i talk to npc, i want to exchange only 15 vote points to vote token. So i need to input the amount of 15 to be exchange. The thing is, this script can only allow me to exchange 1 by 1 and it doesn't have an input option. Here's the script. 

Thank you guys ^^

votenpc.txt

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

try change

			mes "Proceed?";
			if(select("Yes:No")==1)
			{
				set .@points,getPoints(getcharid(3));
				if(.@points>=.@rpoints)
				{
					next;
					mes .npcname$;			
					updatePoints(getcharid(3),.@rpoints);
					getitem .@ritemid,.@rquantity;
					mes "Here you go!. Thank you for voting. Don't forget to vote again. :D";
				}
				else
					mes "Sorry, you do not have enough points for this item.";				
			}

into


			mes "Enter an Amount and proceed:";
			input .@amount, 1;
			if(select("Yes:No")==1)
			{
				set .@points,getPoints(getcharid(3));
				if(.@points>= (.@rpoints * .@amount))
				{
					next;
					mes .npcname$;			
					updatePoints(getcharid(3),(.@rpoints * .@amount));
					getitem .@ritemid,(.@rquantity * .@amount);
					mes "Here you go!. Thank you for voting. Don't forget to vote again. :D";
				}
				else
					mes "Sorry, you do not have enough "+(.@rpoints * .@amount)+" points for this item.";				
			}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  177
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

up! still looking for help

On 8/29/2021 at 10:55 PM, Emistry said:

try change

			mes "Proceed?";
			if(select("Yes:No")==1)
			{
				set .@points,getPoints(getcharid(3));
				if(.@points>=.@rpoints)
				{
					next;
					mes .npcname$;			
					updatePoints(getcharid(3),.@rpoints);
					getitem .@ritemid,.@rquantity;
					mes "Here you go!. Thank you for voting. Don't forget to vote again. :D";
				}
				else
					mes "Sorry, you do not have enough points for this item.";				
			}

into


			mes "Enter an Amount and proceed:";
			input .@amount, 1;
			if(select("Yes:No")==1)
			{
				set .@points,getPoints(getcharid(3));
				if(.@points>= (.@rpoints * .@amount))
				{
					next;
					mes .npcname$;			
					updatePoints(getcharid(3),(.@rpoints * .@amount));
					getitem .@ritemid,(.@rquantity * .@amount);
					mes "Here you go!. Thank you for voting. Don't forget to vote again. :D";
				}
				else
					mes "Sorry, you do not have enough "+(.@rpoints * .@amount)+" points for this item.";				
			}

 

Great! Thabks alot man ?

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...