However, when I save it in inventory and rez it later, it often takes off before I have a chance to touch it and I never see it again. Some time later, it will be returned to my lost and found folder.
Can someone please tell me why? What am I doing wrong?
Thanks in advance.
//Illustrates for loop. Each time the object is touched,
// it moves four times, sleeping 2 seconds between each
// move.
//Note: The object must be physical.
//Global variables
vector initialPosition = <0.0,0.0,0.0>;
default{
state_entry(){
llOwnerSay("Hello, Avatar!"
;//Initialization
initialPosition = llGetPos();
llOwnerSay((string)initialPosition);
llOwnerSay("Initialized"
;}//end state_entry
touch_start(integer total_number){
vector target;
integer cnt;
for(cnt = 0;cnt < 4;cnt++){
if((cnt)%2 == 0){
//Even
target = initialPosition + <1.0,1.0,0.0>;
}else{
//Odd
target = initialPosition - <1.0,1.0,0.0>;
}//end else
llOwnerSay((string)target);
llMoveToTarget(target,0.2);
llSleep(2.0);
}//end for loop
llOwnerSay("touch me again"
;}//end touch_start
on_rez(integer start_param){
llResetScript();
}//end on_rez
}//end default