default
{
state_entry()
{
vector pos = llGetPos();
llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus(STATUS_ROTATE_Z, FALSE);
//llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y, TRUE);
llMoveToTarget(pos,0.4);
// Look for owner within 20 meters in 360 degree arc every 5 seconds.
llSensorRepeat("", llGetOwner(), AGENT, 20.0, PI, 2.0);
}
sensor(integer total_number)
{
// Get position of detected owner
vector pos = llDetectedPos(0);
// Offset back one metre in X and up one metre in Z based on world coordinates.
vector offset =<-1,0,0>;
pos+=offset;
llMoveToTarget(pos,0.4);
list personPos = llGetObjectDetails(llDetectedKey(0), ([OBJECT_POS]));
vector personPos1 = llList2Vector(personPos,0);
llLookAt(personPos1,3.0,1.0);
llSleep(0.5);
llSetPos(personPos1);
}
}
Currently, he's just falling me around like a total gimp, and looking down at the ground all the time. Can someone tell me what I'm doing wrong in my script and how I can correct it? I don't even fully understand what is going on, I mostly took it off the Wiki.
Thanks for any advice.