portal script doesnt work

Results 1 to 6 of 6
  1. #1
    Valued Member WantThat is offline
    MemberRank
    Feb 2013 Join Date
    137Posts

    portal script doesnt work

    the script:
    PHP Code:
    function enter(pi) {
        
    pi.warp(910540000+(pi.getJob()/100)*100,0);

    its portal that take you to map by your job like if its page it will be like that:
    910540000+110/100=1*100=100
    so its supposed to take to 910540000

    and the problem isnt because the way i made it because even if i try like fm
    warp(910000000,0)
    still the same error..
    error:
    PHP Code:
    Error entering Portalscript3rdJob_Port java.lang.reflect.UndeclaredThrowableException 


  2. #2
    Proficient Member funnylord is offline
    MemberRank
    Apr 2010 Join Date
    190Posts

    Re: portal script doesnt work

    are you talking about the 3rd job advancement with the Npc's? (just make the Instance warp to the internal map itself and not the walkway.

    I made it so all jobs use the same map, but the instance checks which job, and spawns the according mob.

  3. #3
    Enthusiast Splend is offline
    MemberRank
    Jan 2013 Join Date
    Great BritishLocation
    48Posts

    Re: portal script doesnt work

    You know you can't just put pi.getJob() like that right?

    I really wish programming can be that easy..

    Try
    Code:
    pi.getPlayer().getJob().getId()

  4. #4
    Have Fun! SuPeR SoNiC is offline
    MemberRank
    Nov 2008 Join Date
    509Posts

    Re: portal script doesnt work

    Undeclared Throwable Exception. It means the method you try to call throws an exception, but you did not provide any code to handle it.
    To fix this, just go to PortalScriptManager and surround the script execution with a try-catch block.

    -Sent from my mobile-

  5. #5
    Valued Member WantThat is offline
    MemberRank
    Feb 2013 Join Date
    137Posts

    Re: portal script doesnt work

    Quote Originally Posted by Splend View Post
    You know you can't just put pi.getJob() like that right?

    I really wish programming can be that easy..

    Try
    Code:
    pi.getPlayer().getJob().getId()
    it doesnt matter even if i just try a regular map it doesnt work but i did proggram another portals but still tnx

  6. #6
    Enthusiast Splend is offline
    MemberRank
    Jan 2013 Join Date
    Great BritishLocation
    48Posts

    Re: portal script doesnt work

    Quote Originally Posted by SuPeR SoNiC View Post
    Undeclared Throwable Exception. It means the method you try to call throws an exception, but you did not provide any code to handle it.
    To fix this, just go to PortalScriptManager and surround the script execution with a try-catch block.

    -Sent from my mobile-
    His script only have 3 lines. It is so obvious which line it is.
    Even if his pi.getJob() worked, it would return a MapleJob object.
    How does MapleJob/100 going to work?



Advertisement