CODE
link_message(integer sender_num, integer num, string str, key id)
{
key x = id;
llSetTimerEvent(.5);
length = num;
}
sensor(integer numb)
{
var_one = llDetectedPos(0);
var_two = llVecDist(leash_one, leash);
var_des = leash_one + <0,leash_length,0>;
if(var_two > length)
{
llSetPrimitiveParams([PRIM_PHYSICS, TRUE]);
target = llTarget(var_des,length);
llMoveToTarget(var_des,0.5);
}
}
at_target(integer tnum, vector targpos, vector ourpos)
{
llTargetRemove(target);
llStopMoveToTarget();
llSetPrimitiveParams([PRIM_PHYSICS,FALSE]);
}
Ok so, thats the pertinent part of the code, to answer questions I know will be asked, a key has been defined to tell the sensor a speficif key its looking for in order to obtain its distance from the script and supply a varible for llVecDist. There is a sensor event because a sensor is being set of by way of llSetTimerEvent every 0.5 seconds and finally this is coming in through link message because the parent script was getting close to memory bounds and with the way this product will be marketed it was simply easier to put this function in a seperate script so it could either be added or removed.