Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Created by Musical Memo.
  2. //To use, you will need to be able to access the contents of two different prims/objects in-world within the same region. Place a script in each, then touch each once. The measurements should then pop up in OwnerSay chat on your screen. This script automatically deletes in both prims as well, after measurements have been made.
  3.  
  4. integer c=-333;
  5. default
  6. {
  7.     touch_start(integer nd)
  8.     {
  9.         llListen(c,"","","");
  10.         llRegionSay(c,(string)llGetPos());
  11.     }
  12.     listen(integer c,string n,key i,string m)
  13.     {
  14.         if(llSubStringIndex(m,">")!=-1)
  15.         {
  16.             vector cp=llGetPos();
  17.             vector p=(vector)m;
  18.             vector center=(((cp-p)/2)+p);
  19.             float d=llVecDist(cp,p);
  20.             float center_d=d/2;
  21.             llOwnerSay("\nCENTER X POS: "+(string)center.x+"\nCENTER Y POS: "+(string)center.y+"\nCENTER Z POS: "+(string)center.z+"\nTOTAL DISTANCE: "+(string)d+"\nCENTER DISTANCE: "+(string)center_d);
  22.             llRegionSay(c,"clear");
  23.             llRemoveInventory(llGetScriptName());
  24.         }
  25.         else if(m=="clear")
  26.         {
  27.             llRemoveInventory(llGetScriptName());
  28.         }
  29.     }
  30.     on_rez(integer sp)
  31.     {
  32.         llResetScript();
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement