This is code:
string avatar;
string avatar_ena;
integer status=1;
integer stevec=0;
key uuid;
key owner;
vector rotationCenter;
default
{
state_entry()
{
uuid= llGetKey();
owner = llGetOwner();
llListen( 995, "", NULL_KEY, ""

;
llSetStatus(STATUS_PHYSICS, TRUE);
llSensorRepeat("", llDetectedName(0), AGENT, 50.0, PI, 0.4); //
}
sensor(integer skupaj)
{
llSay(211,"phobia"

;
stevec++;
if(stevec==1){
avatar_ena=llDetectedName(0);
avatar=llDetectedName(0);
}
else avatar=llDetectedName(0);
// llSay(0,llGetOwner());
if(avatar==avatar_ena)
{
vector pozicija_avatarja=llDetectedPos(0);
vector pozicija_objekta=llGetPos();
float x1=pozicija_avatarja.x;
float x2=pozicija_objekta.x;
float y1=pozicija_avatarja.y;
float y2=pozicija_objekta.y;
float razdalja2= (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
float razdalja = llSqrt(razdalja2);
// llSay(0,(string)razdalja+(string)llDetectedPos(0));
if(razdalja>10)
{
llMoveToTarget(llDetectedPos(0),0.1);
}
else
{
// llSay(0,(string)llGetPos());
vector pos = llDetectedPos(0); // prebere prvi rezultat skeniranja (indeks 0) in sicer pozicijo
vector startPoint = llGetPos();
if(pos.z<23){ pos.z=23; rotationCenter = pos; }
else rotationCenter = pos;
rotation Z_15 = llEuler2Rot( < 0, 0, 20 * DEG_TO_RAD > );
integer r;
// for( r = 1; r < 100; r++ )
//{
vector currentPosition = llGetPos();
vector currentOffset = currentPosition - rotationCenter;
//rotation center je pozicija avatarja
vector rotatedOffset = currentOffset * Z_15;
vector newPosition = rotationCenter + rotatedOffset;
newPosition.z -= rotatedOffset.z;
//llSay(0,(string)pos +" pos pajka: " + (string)newPosition+" offset: "+ (string)rotatedOffset);
llMoveToTarget(newPosition,0.3);
}
}
}
listen(integer channel, string name, key id, string choice )
{
string primerjava = "You are cured "+ avatar;
if(primerjava == choice)
{
llSay(0,choice+ " You had phobia."

;
llSay(995,"bolezen"

;
status=0;
llSay(994,"izbris"

;
llDie();
}
else llSay(998,"You are not infected."

;
}
}