Jump to content
  • 0

NPC not checking zeny or taking zeny correctly.


Question

Posted

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.

3 answers to this question

Recommended Posts

  • 0
Posted
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
  • 0
Posted

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.

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