Jump to content
  • 0

Npc can't auto trigger not moving player


Question

Posted (edited)

I know auto trigger can't trigger not moving player

But that's OK on not moving npc.

 

Now I want use a moving npc to auto trigger player.

like this:

Quote

job_sword1,117,238,1    script    electricity    1002,1,1,{
     warp "prontera",155,187;
     end;
OnInit:
    npcspeed 60;
    npcwalkto 130,250;
    end;
}

 

But player not moving will not warp to prontera.

I think maybe can use

0.for loop

1.getmapxy  => to get npc position

2.getareausers => to get npc position area users, if getareauser >0   areawarp

3. sleep 100

But if I had 50+ moving npc, maybe that will Consume a lot of CPU resources?

Have other better method to auto trigger not moving player?

Thank you!!

Edited by bluesky

2 answers to this question

Recommended Posts

  • 0
Posted

I'm not quite sure what you mean, like this perhaps? :huh:

job_sword1,117,238,1    script    electricity    1002,1,1,{
OnTouch: // Player has entered NPC's area
  warp "prontera",155,187;
  end;
OnInit:
  npcspeed 60;
  npcwalkto 130,250;
  end;
} 

You can increase the NPC's area of effect: 1002,2,2,{

But i'm not sure if OnTouch event will work on moving NPC's.

  • 0
Posted
12 hours ago, Sehrentos said:

I'm not quite sure what you mean, like this perhaps? :huh:


job_sword1,117,238,1    script    electricity    1002,1,1,{
OnTouch: // Player has entered NPC's area
  warp "prontera",155,187;
  end;
OnInit:
  npcspeed 60;
  npcwalkto 130,250;
  end;
} 

You can increase the NPC's area of effect: 1002,2,2,{

But i'm not sure if OnTouch event will work on moving NPC's.

 

if NPC's moving to player around and player not moving,then will not  trigger OnTouch

Now I used

for {

getmapxy

getareausers ,

}

it's work.

Thank you:D

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...