Advertisement
nebadon2025

Untitled

Jan 23rd, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. integer filter;// default is 0
  2.  
  3. default
  4. {
  5.  
  6. touch_start(integer total_number)
  7. {
  8. vector start = llGetPos();
  9. vector ground = start;
  10. ground.z = llGround( ZERO_VECTOR );
  11. vector end = <start.x, start.y, ground.z>;
  12.  
  13. if ( filter > 8 )
  14. filter = 0;
  15.  
  16. llOwnerSay("Filter " + (string)filter);
  17.  
  18. list results = llCastRay(start, end, [RC_REJECT_TYPES, filter, RC_MAX_HITS, 1] );
  19.  
  20. integer hitNum = 0;
  21. // Handle error conditions here by checking llList2Integer(results, -1) >= 0
  22. while (hitNum < llList2Integer(results, -1))
  23. {
  24. // Stride is 2 because we didn't request normals or link numbers
  25. key uuid = llList2Key(results, 2*hitNum);
  26.  
  27. string name = "Land"; // if (uuid == NULL_KEY)
  28. list pos;
  29.  
  30. if (uuid != NULL_KEY)
  31. name = llKey2Name(uuid);
  32. pos = llGetObjectDetails(uuid, ([OBJECT_POS]));
  33.  
  34. llOwnerSay("Start :" + (string)start + "-" + "End : " + (string)end + " - Hit : " + name + " - Location : " + llList2String(pos,0) + ".");
  35.  
  36. ++hitNum;
  37. }
  38.  
  39. ++filter;
  40. llResetScript();
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement