Jump to content
  • 0

question and answer npc


Brynner

Question


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

how to make an npc who will ask you and you need to answer the 10 question correctly. if not, you are not qualified to do this quest.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

setarray .@Questions$[1],
"First question!",
"Second question!",
// etc.
"Last question";
setarray .@Answers$[1],
"First answer!",
"Second answer!",
// etc.
"Last answer";

set .@correct,0;
for(set .@i,1; .@i<=10; set .@i,.@i+1) {
mes "[Question "+.@i+"]";
mes .@Questions$[.@i];
input .@input$;
if (.@input$ == .@Answers$[.@i]) set .@correct, .@correct+1;
// Use the line below instead if case (capitals/non-capitals) does not matter
// if (compare(.@input$,.@Answers$[.@i])) set .@correct, .@correct+1;
next; }
mes "[score]";
mes "^FF0000"+.@correct+"^000000 correct of 10 total.";
if (.@correct > YOUR_NUMBER) {
// your script
}
close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Either switch(select()) or input+conditional - you'll need to be more specific than that.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

Either switch(select()) or input+conditional - you'll need to be more specific than that.

ex. same on the hunter quest exam. you need to answer all questions correctly. if im not mistaken it is a 10 questions? then you need to answer it correctly for you to able to make an change job right? but i just want to make an simple question and answer scripts.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

Then it's really easy to script it with the "switch(select( " Script command,like this :

This is how it could look like :

http://upaste.me/4ce0502abdbeab4

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

thanks for this.

how about you need to imput the correct answer? example you input the correct answer but if you put a wrong answer. he will continue the question until it finish the 10 questions. but in the end the summary will appear. your score will show. if you get 8 out of 10 you'll pass. but if you got 7 below you failed.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

setarray .@Questions$[1],
"First question!",
"Second question!",
// etc.
"Last question";
setarray .@Answers$[1],
"First answer!",
"Second answer!",
// etc.
"Last answer";

set .@correct,0;
for(set .@i,1; .@i<=10; set .@i,.@i+1) {
mes "[Question "+.@i+"]";
mes .@Questions$[.@i];
input .@input$;
if (.@input$ == .@Answers$[.@i]) set .@correct, .@correct+1;
// Use the line below instead if case (capitals/non-capitals) does not matter
// if (compare(.@input$,.@Answers$[.@i])) set .@correct, .@correct+1;
next; }
mes "[score]";
mes "^FF0000"+.@correct+"^000000 correct of 10 total.";
if (.@correct > YOUR_NUMBER) {
// your script
}
close;

can you make sa sample script and post it to http://upaste.me

Edited by Brynner
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...