Jump to content

Vector target


Shihan Feiri
 Share

You are about to reply to a thread that has been inactive for 4690 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Ok Inside script I have in  head vector target value:

 

vector target=<232,204,37>;

 

I need that script read vector target from descripton.  I have try with llGetObjectDesc(); but have some problem with that . This is TP script:

vector target=<232,204,37>;

vector offset;

default
{    
    moving_end()
    {
        offset = (target- llGetPos()) * (ZERO_ROTATION / llGetRot());
        llSitTarget(offset, ZERO_ROTATION); 
    }

    state_entry()
    {
        llSetText("Return ( Dime )",<0,1,1>,1.0);
        offset = (target- llGetPos()) * (ZERO_ROTATION / llGetRot());
        llSetSitText("Teleport");
        llSitTarget(offset, ZERO_ROTATION);      
    }

    changed(integer change) 
    { 
        if (change & CHANGED_LINK) 
        { 
            llSleep(0.5); 
            if (llAvatarOnSitTarget() != NULL_KEY) 
            { 
                llUnSit(llAvatarOnSitTarget()); 
            }
        }
    }
    
    touch_start(integer i)
    {
        llSay(0, "Please right-click and select Teleport");
    }
}

 

 

Link to comment
Share on other sites

You might try something like this...

 

vector target(){    return (vector)llGetObjectDesc();}vector offset;default{        moving_end()    {        offset = (target()- llGetPos()) * (ZERO_ROTATION / llGetRot());        llSitTarget(offset, ZERO_ROTATION);     }    state_entry()    {        llSetText("Return ( Dime )",<0,1,1>,1.0);        offset = (target()- llGetPos()) * (ZERO_ROTATION / llGetRot());        llSetSitText("Teleport");        llSitTarget(offset, ZERO_ROTATION);          }    changed(integer change)     {         if (change & CHANGED_LINK)         {             llSleep(0.5);             if (llAvatarOnSitTarget() != NULL_KEY)             {                 llUnSit(llAvatarOnSitTarget());             }        }    }        touch_start(integer i)    {        llSay(0, "Please right-click and select Teleport");    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4690 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...