Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer filter;// default is 0
- default
- {
- touch_start(integer total_number)
- {
- vector start = llGetPos();
- vector ground = start;
- ground.z = llGround( ZERO_VECTOR );
- vector end = <start.x, start.y, ground.z>;
- if ( filter > 8 )
- filter = 0;
- llOwnerSay("Filter " + (string)filter);
- list results = llCastRay(start, end, [RC_REJECT_TYPES, filter, RC_MAX_HITS, 1] );
- integer hitNum = 0;
- // Handle error conditions here by checking llList2Integer(results, -1) >= 0
- while (hitNum < llList2Integer(results, -1))
- {
- // Stride is 2 because we didn't request normals or link numbers
- key uuid = llList2Key(results, 2*hitNum);
- string name = "Land"; // if (uuid == NULL_KEY)
- list pos;
- if (uuid != NULL_KEY)
- name = llKey2Name(uuid);
- pos = llGetObjectDetails(uuid, ([OBJECT_POS]));
- llOwnerSay("Start :" + (string)start + "-" + "End : " + (string)end + " - Hit : " + name + " - Location : " + llList2String(pos,0) + ".");
- ++hitNum;
- }
- ++filter;
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement