Jump to content
  • 0

NPC not checking zeny or taking zeny correctly.


Rallycart

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/10/17
  • Last Seen:  

Hello, here is the section of script that isnt working:

		mes "[Bathory]";
		mes "Kafra Points cost 1000z each.";
		mes "How many KP would you like?";
		input .@amountbath;
		.@inputbath = .amountbath*1000;
		next;
		if (Zeny<.inputbath) {
			mes "[Bathory]";
			mes "You do not have enough zeny.";
			close;
		}
		mes "[Bathory]";
		mes "Coming right up!";
		close2;
		set Zeny, Zeny-.inputbath;
		#CASHPOINTS += .amountbath;;
		end;

It loads without error, and will let you do an input. However, even if you dont have enough zeny, it skips the if statement, it doesnt take any zeny, and it doesnt give any of the cash points either. Can anyone enlighten me as to what is wrong here? Thanks.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   616
  • Joined:  07/05/12
  • Last Seen:  

Double check the typo of your variables. For example the amount variable name change in

		input .@amountbath;
		.@inputbath = .amountbath*1000;

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1691
  • Reputation:   716
  • Joined:  12/21/14
  • Last Seen:  

mes "[Bathory]";
		mes "Kafra Points cost 1000z each.";
		mes "How many KP would you like?";
		input .@amountbath;
		.@inputbath = .@amountbath*1000;
		next;
		if (Zeny<.@inputbath) {
			mes "[Bathory]";
			mes "You do not have enough zeny.";
			close;
		}
		mes "[Bathory]";
		mes "Coming right up!";
		close2;
		set Zeny, Zeny-.@inputbath;
		#CASHPOINTS += .@amountbath;;
		end;

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/10/17
  • Last Seen:  

Ah, ok. I must have glanced the help files too quickly, and thought that you called NPC variables without the @. Looks like that was actually to create an array, lol. Sorry for wasting your time.

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