Help npcscript, pls!

Results 1 to 5 of 5
  1. #1
    Account Upgraded | Title Enabled! GabrielSin is offline
    MemberRank
    Apr 2010 Join Date
    483Posts

    Help npcscript, pls!

    I need a script that works in the following way, if anyone knows how to help me.

    example:

    I need a NPC that is available at time x.
    Ie, that runs between 15:00 and 20:00.
    If you are not at this time it returns saying that the NPC is closed or something.

    Try to give a start script :

    PHP Code:
    function start() {
        if (
    hour x) { //hour = 15/20 etc.
        
    cm.warp(100000000);
        
    cm.dispose();
    } else {
        
    cm.sendOk("NPC closed.");
        
    cm.dispose();
      }



  2. #2
    That one pokemon thing Luxray is offline
    MemberRank
    Apr 2010 Join Date
    2,043Posts

    Re: Help npcscript, pls!

    I'm not really sure, but maybe this would work.
    PHP Code:
    var = new Date();
    var 
    d.getHours();

    if(
    >= 15 && <= 20) {
        
    warp.
    } else {
        
    closed

    You might need an importPackage.

  3. #3
    Account Upgraded | Title Enabled! GabrielSin is offline
    MemberRank
    Apr 2010 Join Date
    483Posts

    Re: Help npcscript, pls!

    Quote Originally Posted by The Sharingan View Post
    I'm not really sure, but maybe this would work.
    PHP Code:
    var = new Date();
    var 
    d.getHours();

    if(
    >= 15 && <= 20) {
        
    warp.
    } else {
        
    closed

    You might need an importPackage.

    This way?

    PHP Code:
    /* vars */
    var status 0;
    var 
    date = new Date();
    var 
    hour date.getHours();


    function 
    start(){
        
    cm.sendNext("You want to start the quest?");
    }

    function 
    action(modetypeselection) {

     var 
    em cm.getEventManager("CashPQ");

     if(
    hour >= 15 && hour <= 20) {
        
    em.startInstance(cm.getChar().getMap());
        
    cm.dispose(); 
        } else {
        
    cm.sendOk("NPC closed."); 
        
    cm.dispose();
     } 

  4. #4
    That one pokemon thing Luxray is offline
    MemberRank
    Apr 2010 Join Date
    2,043Posts

    Re: Help npcscript, pls!

    I guess. Why don't you try?

  5. #5
    Account Upgraded | Title Enabled! GabrielSin is offline
    MemberRank
    Apr 2010 Join Date
    483Posts

    Re: Help npcscript, pls!

    Quote Originally Posted by The Sharingan View Post
    I guess. Why don't you try?
    Okay, I'll try, give results soon.



Advertisement