Jump to content
Billy

Question NPC

Recommended Posts

Customisable question NPC.

Table for questions/answers/prizes.

Function to refresh questions.

Function to clear answer records.

Player can only answer each question once (until records are cleared).

 

(EDIT: Added auto refresh after X seconds, set delay to 0 to disable)

(EDIT: 17/05/16 : Added MinLevel and MaxLevel parameter to questions)

 

http://pastebin.com/c2T5530V

  • Like 6

Share this post


Link to post
Share on other sites

How to add Level Trigger?

 

QuestionNpc.ErrorLevel = "You need Lv 40 for answer this question."
--Checks Level.
function QuestionNpc.CheckLevel(QuestionID,AnswerID)
    if QuestionNpc.Questions[QuestionID].Answer == AnswerID then
        QuestionNpc.Error = LvCheck, ">", 40,
        return 1
    else
        QuestionNpc.Error = QuestionNpc.ErrorLevel
        return 0
    end
end

 

InitTrigger()
            TriggerCondition( 1, QuestionNpc.CheckLevel,ChosenQuestion)

 

help me? @7n6

Edited by DevMorgan

Share this post


Link to post
Share on other sites
13 hours ago, DevMorgan said:

How to add Level Trigger?

 


QuestionNpc.ErrorLevel = "You need Lv 40 for answer this question."

--Checks Level.
function QuestionNpc.CheckLevel(QuestionID,AnswerID)
    if QuestionNpc.Questions[QuestionID].Answer == AnswerID then
        QuestionNpc.Error = LvCheck, ">", 40,
        return 1
    else
        QuestionNpc.Error = QuestionNpc.ErrorLevel
        return 0
    end
end

 


InitTrigger()
            TriggerCondition( 1, QuestionNpc.CheckLevel,ChosenQuestion)

 

help me? @7n6

Updated the download link, now has MinLevel and MaxLevel parameters for each question. 

You can leave either as nil if you don't want a min or max level for a question

 

(Also I think I renamed one of the functions (TimeCheck -> CheckTime) , so if it doesnt work make sure to update that in your missionsdk)

  • Like 1

Share this post


Link to post
Share on other sites

Can someone upload the script again please?


“So the problem is not so much to see what nobody has yet seen, as to think what nobody has yet thought concerning that which everybody sees.”


― Arthur Schopenhauer

Share this post


Link to post
Share on other sites
28 minutes ago, Methz said:

Can someone upload the script again please?

added pastebin, for future referance if links dont work change daylight-online.ru/xxxxx to pkodev.net/xxxxxx

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for the script and tip :pleasantry:


“So the problem is not so much to see what nobody has yet seen, as to think what nobody has yet thought concerning that which everybody sees.”


― Arthur Schopenhauer

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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