Jump to content
  • 0

How to show the value of a var in a NPC message?


eKoh

Question


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  01/07/12
  • Last Seen:  

Hello guys, I am trying to add a Donation Npc. I succesfully did the easy parts but now that I want to make it to show how many Donation points do the player has and I am not able to do it.
 
 

mes "How many eKoins do you want to exchange?";
                        mes "^0000FF 1 eKoin = 100 Donation Points^000000";
                        input .@amount;
                            if (.@amount == 0) {
                            mes "[^0000FFDonation-Vote Girl^000000]";
                            mes "Please input a number higher than 0.";
                            close;
                            }
                        else{
                        set #DONATIONPOINTS, #DONATIONPOINTS+.@amount*100;
                        delitem 26000,.@amount;
                        mes "Here you go!";
                        close;
              ----->  mes "Available Amount : "+ValueConvert( getd(#DONATIONPOINTS) )+"^000000";
                        }

 
I tried that instruction with the arrow to make it work (and others), but they just dont work =/

Btw, anything that could make easier/better this code or any suggestion would be appreciated =)


cmon guys, I really need help =/

Edited by eKoh
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


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

mes "Available Amount : "+ValueConvert( getd(#DONATIONPOINTS) )+"^000000";

You make thing too hard. To display the value of #DONATIONPOINTS, it's.. well..

mes "Available Amount : "+ #DONATIONPOINTS +"^000000";

Also you miss a step in your script.

  • player input amount
  • you check the input (.@amount == 0)
  • check if the player have the amount of eKoin - you forgot this part
  • etc..
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  01/07/12
  • Last Seen:  

God bless you @Capuche thank you a lot, it worked perfectly. And also I've just added those things you said I was missing, now it is working perfectly ;D!!!

 

Btw, is there a Scripting Bible or something?xD

Link to comment
Share on other sites


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

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