salahzar

Script achille

Apr 5th, 2013
159
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list keys = [];
  2. key npc;
  3. string toucher;
  4. key toucherkey;
  5. vector toucherPos;
  6. integer npc_on = FALSE;
  7.  
  8. integer toggle=0;
  9.  
  10. goA()
  11. {
  12.        osNpcMoveToTarget(npc,<51.8792, 41.5985, 23.3226>,OS_NPC_RUNNING|OS_NPC_NO_FLY);
  13. }
  14. goB()
  15. {
  16.  
  17.         osNpcMoveToTarget(npc,<85.4375, 38.4954, 23.3226>,OS_NPC_NO_FLY );
  18. }
  19.  
  20. default
  21. {
  22.     state_entry()
  23.     {
  24.         if(llGetObjectDesc()!="") osNpcRemove((key)llGetObjectDesc());
  25.         llListen(10,"",NULL_KEY,"");
  26.           llSensor("", "", AGENT | NPC, 96.0, PI); //Will always return NPC key regardless of npc create option
  27.  
  28.     }
  29.     timer()
  30.     {
  31.         toggle=1-toggle;
  32.         if(toggle==0) { goA(); llSetTimerEvent(8);}
  33.         if(toggle==1) {goB(); llSetTimerEvent(12);}
  34.     }
  35.     listen(integer channel,string name, key id, string str)
  36.     {
  37.         if(str=="A")
  38.         {
  39.             goA();
  40.             return;
  41.         }
  42.         if(str=="B")
  43.         {
  44.             goB();
  45.             return;
  46.         }
  47.     }
  48.     touch_start(integer x)
  49.     {  
  50.         toucherkey = llDetectedKey(0);
  51.         toucherPos = llDetectedPos(0);
  52.         vector npcPos = llGetPos() + <1,1,1>;
  53.  
  54.         if(npc_on == FALSE)
  55.         {    
  56.             npc = osNpcCreate("Achille", "PièVeloce", npcPos, toucherkey);
  57.             llSetObjectDesc((string)npc);
  58.             npc_on = TRUE;
  59.             llSetTimerEvent(0.01);
  60.           //  llSensor("", "", AGENT | NPC, 96.0, PI); //Will always return NPC key regardless of npc create option
  61.             return;
  62.         }  
  63.  
  64.         if(npc_on == TRUE)
  65.         {  
  66.             llSetTimerEvent(0);
  67.             osNpcRemove(npc);
  68.             llSetObjectDesc("");
  69.  
  70.             llResetScript();
  71.  
  72.         }  
  73.     }  
  74.  
  75.     sensor(integer num)
  76.     {  
  77.         keys = [];
  78.         integer i = 0;
  79.  
  80.         for(i; i < num; i++)
  81.         {  
  82.             keys += llDetectedKey(i);
  83.             osNpcRemove(llDetectedKey(i));
  84.         }  
  85.  
  86.         llOwnerSay(llDumpList2String(keys, "\n"));
  87.     }  
  88.  
  89.     no_sensor()
  90.     {  
  91.         keys = [];  
  92.     }  
  93. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×