i am trying to make 2 objects communicating with eachother and getting infos from the avatars nearby and passing it on to the objects,
so this is the script of my sensorobject(in the inventory of this i have the child object)
and my problem is in the last line of this script, i wanted the whole procedure to be repeated just the key_list shouldnt get empty by the second running of the script,...but i have no idea how...thnx for ur help,
string avKey;
integer list_pos;
list key_list;
integer key_chan;
integer die_chan = -1111;
integer key_rem_chan = -2222;
default {
state_entry() {
llSetObjectName("Sensor"
;llSensorRepeat("", "", AGENT, 5, PI, 1);
key_list =[];
llListen(key_rem_chan, "", "", ""
; }
sensor(integer iNum) {
integer p = 0;
for (p = 0; p < iNum; ++p) {
avKey = llDetectedKey(p);
list_pos = llListFindList(key_list,[avKey]);
if (list_pos == -1) {
key_list = (key_list =[]) + key_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) {
key remove_key = msg;
integer r = llListFindList(key_list,[remove_key]);
llDeleteSubList(key_list, r, r);
Scan=FALSE;
llResetScript(); //shouldnt delete the key list!!but how?!
}
}
(