bdhtrn

{COSE}seekerdrone

Mar 31st, 2011
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. key prey;
  2.  
  3. goto(vector destination){
  4.     integer ok=0;
  5.     do{
  6.         if(llGetPos()!=destination)
  7.             llSetPrimitiveParams([PRIM_POSITION, destination]);
  8.         else    ok=1;
  9.     } while(ok==0);
  10.     llSensor("",prey,AGENT,30,PI);
  11. }
  12.  
  13. default{
  14.     on_rez(integer param){
  15.         llListen(param,"","","");
  16.         llSetAlpha(0.5,-1);
  17.         llSetPrimitiveParams([PRIM_PHANTOM,TRUE]);
  18.     }
  19.     state_entry(){
  20.     }
  21.     listen(integer chan,string av,key id,string msg){
  22.         prey=(key)msg;
  23.         list pos = llGetObjectDetails(prey,[OBJECT_POS]);
  24.         goto(llList2Vector(pos,0));
  25.     }
  26.     sensor(integer num_det){
  27.         vector preypos = llDetectedPos(0);
  28.         float dist = llVecDist(llGetPos(),preypos);
  29.         if(dist>0.9){
  30.             goto(preypos);
  31.         }
  32.         else{
  33.             llRezObject("quarantine",preypos+<0,0,0.5>,ZERO_VECTOR,ZERO_ROTATION,1);
  34.             llDie();
  35.         }
  36.     }
  37.     no_sensor(){
  38.         llOwnerSay("target lost. dying");
  39.         llDie();
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment