This script sets up properly in Kitely and says it is working (no errors at all) it even recognizes the avatar you are to follow, but will not work. Does anyone know how I can make it work in Kitely? It works in SL. Thanks

Code: Select all
integer CHANNEL = 15; // That's "f" for "follow", haha
float DELAY = 0.5; // Seconds between blinks; lower for more lag
float RANGE = 3.0; // Meters away that we stop walking towards
float TAU = 1.0; // Make smaller for more rushed following
// Avatar Follower script, by Dale Innis
// Do with this what you will, no rights reserved
// See https://wiki.secondlife.com/wiki/AvatarFollower for instructions and notes
float LIMIT = 60.0; // Approximate limit (lower bound) of llMoveToTarget
integer lh = 0;
integer tid = 0;
string targetName = "";
key targetKey = NULL_KEY;
integer announced = FALSE;
init() {
llListenRemove(lh);
lh = llListen(CHANNEL,"",llGetOwner(),"");
}
stopFollowing() {
llTargetRemove(tid);
llStopMoveToTarget();
llSetTimerEvent(0.0);
llOwnerSay("No longer following.");
}
startFollowingName(string name) {
targetName = name;
llSensor(targetName,NULL_KEY,AGENT_BY_LEGACY_NAME,96.0,PI); // This is just to get the key
}
startFollowingKey(key id) {
targetKey = id;
llOwnerSay("Now following "+targetName);
keepFollowing();
llSetTimerEvent(DELAY);
}
keepFollowing() {
llTargetRemove(tid);
llStopMoveToTarget();
list answer = llGetObjectDetails(targetKey,[OBJECT_POS]);
if (llGetListLength(answer)==0) {
if (!announced) llOwnerSay(targetName+" seems to be out of range. Waiting for return...");
announced = TRUE;
} else {
announced = FALSE;
vector targetPos = llList2Vector(answer,0);
float dist = llVecDist(targetPos,llGetPos());
if (dist>RANGE) {
tid = llTarget(targetPos,RANGE);
if (dist>LIMIT) {
targetPos = llGetPos() + LIMIT * llVecNorm( targetPos - llGetPos() ) ;
}
llMoveToTarget(targetPos,TAU);
}
}
}
default {
state_entry() {
llOwnerSay("/"+(string)CHANNEL+" [name of person to magically follow]");
init();
}
on_rez(integer x) {
llResetScript(); // Why not?
}
listen(integer c,string n,key id,string msg) {
if (msg == "off") {
stopFollowing();
} else {
startFollowingName(msg);
}
}
no_sensor() {
llOwnerSay("Did not find anyone named "+targetName);
}
sensor(integer n) {
startFollowingKey(llDetectedKey(0)); // Can't have two ppl with the same name, so n will be one. Promise. :)
}
timer() {
keepFollowing();
}
at_target(integer tnum,vector tpos,vector ourpos) {
llTargetRemove(tnum);
llStopMoveToTarget();
}
}