Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key prey;
- goto(vector destination){
- integer ok=0;
- do{
- if(llGetPos()!=destination)
- llSetPrimitiveParams([PRIM_POSITION, destination]);
- else ok=1;
- } while(ok==0);
- llSensor("",prey,AGENT,30,PI);
- }
- default{
- on_rez(integer param){
- llListen(param,"","","");
- llSetAlpha(0.5,-1);
- llSetPrimitiveParams([PRIM_PHANTOM,TRUE]);
- }
- state_entry(){
- }
- listen(integer chan,string av,key id,string msg){
- prey=(key)msg;
- list pos = llGetObjectDetails(prey,[OBJECT_POS]);
- goto(llList2Vector(pos,0));
- }
- sensor(integer num_det){
- vector preypos = llDetectedPos(0);
- float dist = llVecDist(llGetPos(),preypos);
- if(dist>0.9){
- goto(preypos);
- }
- else{
- llRezObject("quarantine",preypos+<0,0,0.5>,ZERO_VECTOR,ZERO_ROTATION,1);
- llDie();
- }
- }
- no_sensor(){
- llOwnerSay("target lost. dying");
- llDie();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment