have tried a few simple things with no effect really.. the main thing I saw to change was the sensor repeat line... which as the above says.. screwed it up lol.. like I said.. don't really know what I'm doing here so......
integer Scan = TRUE;
string avKey;
integer list_pos;
list key_list;
integer key_chan; //Key channel is generated randomly and passed to the scan ball
integer die_chan = -9423753; //Hey pick your own channels and be sure to paste them into the scan balls too!
integer key_rem_chan = -49222879;
default {
state_entry() {
llSetObjectName("3D Radar");
}
touch_start(integer total_number) {
if (Scan) {
llGetAgentList(AGENT_LIST_REGION, []);
key_list =[];
llListen(key_rem_chan, "", "", "");
llOwnerSay("on");
Scan = FALSE;
}
else {
llSensorRemove();
llRegionSay(die_chan, "die");
llOwnerSay("off");
Scan = TRUE;
}
}
sensor(integer iNum) {
integer p = 0;
for (p = 0; p < iNum; ++p) {
avKey = llDetectedKey(p);
list_pos = llListFindList(key_list, (list)avKey);
if (list_pos == -1) {
key_list += (list) avKey;
key_chan = (integer) llFrand(-1000000) - 1000000;
llRezObject("scan ball", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, key_chan);
llSleep(.25);
llRegionSay(key_chan, avKey);
}
}
}
listen(integer c, string name, key id, string msg) {
integer r = llListFindList(key_list,[(key)msg]);
key_list = llDeleteSubList(key_list, r, r);
}
}
oh and here is the other part if that's needed for the scan ball as well.....
string avName;
integer avDistance;
key avKey;
integer avListen;
integer key_chan;
integer die_chan = -9423753;
integer key_rem_chan = -49222879;
vector avPos;
vector rPos;
default {
state_entry() {
llSetObjectName("scan ball");
}
on_rez(integer start_param) {
rPos = llGetPos();
key_chan = start_param;
llListen(die_chan, "", "", "");
avListen = llListen(key_chan, "", "", "");
}
listen(integer c, string n, key id, string msg) {
if (c == die_chan)
llDie();
else {
avKey = (key) msg;
avName = llKey2Name(avKey);
llGetAgentList(AGENT_LIST_REGION, []);
llListenRemove(avListen);
}
}
sensor(integer n) {
avPos = llDetectedPos(0);
vector avDivPos = (avPos - rPos) / (96 / 1); //Scan range/Radius of large sphere
avDistance = (integer) llVecDist(rPos, llDetectedPos(0));
llSetPos(rPos + avDivPos);
llSetText(avName + "[" + (string) avDistance + "]", <1, 1, 1 >, 1);
}
no_sensor() {
llRegionSay(key_rem_chan, avKey);
llDie();
}
}