I built a skybox in the mainland. I was trying to write a script to go up to it with limited success. I then found a script in the marketplace to do this and bought it. ( no response from the creator but it was very cheep) The script works well but the object that i inserted the script into 'follows me up into the sky ' it is always a bit below me ( can get exact coordinates if needed) can anyone tell me why this is happening or what I should do?
Here is a copy of the script
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/ The script begins _/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
vector destination = <175,88,1001>; // the destination coordinate
string text = "Touch To Teleport"; // optional floating text on the teleporter, input a space if not used
vector text_color = <1.0,1.0,1.0>; // the floating text's color
integer touch2sit = TRUE; // TRUE - left click to sit; FALSE - left click to touch
integer access_mode = 1; // 1 - public; 2 - owner; 3 - group;
//=================================================
posJump( vector target_position )
{// Trickery discovered by Uchi Desmoulins and Gonta Maltz. More exact value provided by Fake Fitzgerald.
llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_position ]);
}
//=================================================
warpPos( vector destpos )
{ //R&D by Keknehv Psaltery, 05/25/2006; unlimited modified by Klug Kuhn 10/01/2008
// Change this safety range depends on your script memory
// The larger the range, the quicker (and less "flashes") to get to the destination, however, the more to eat up script memory.
float safety_range = 1000.0;
integer arrived = FALSE;
integer within_range = FALSE;
vector inter_pos = ZERO_VECTOR;
vector current_pos = llGetPos();
vector checking_pos = destpos;
integer jumps = 0;
list rules = [];
integer count = 0;
if (llVecDist(destpos, current_pos) <= safety_range)
{
jumps = (integer)(llVecDist(destpos, current_pos) / 10.0) + 1;
rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}
else
{
while (!arrived)
{
current_pos = llGetPos();
checking_pos = destpos;
within_range = FALSE;
while (!within_range)
{
if (llVecDist(checking_pos,current_pos) > safety_range)
{
checking_pos = <(current_pos.x + checking_pos.x) / 2.0,(current_pos.y + checking_pos.y) / 2.0,(current_pos.z + checking_pos.z) / 2.0>;
}
else
{
within_range = TRUE;
if (llVecDist(destpos, current_pos) <= safety_range)
{
jumps = (integer)(llVecDist(destpos, current_pos) / 10.0) + 1;
rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
arrived = TRUE;
}
}
}
if (!arrived)
{
jumps = (integer)(llVecDist(checking_pos, current_pos) / 10.0) + 1;
rules = [ PRIM_POSITION, checking_pos ]; //The start for the rules list
count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}
}
}
}
//=================================================
default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.01>, ZERO_ROTATION);
llSetText(text,text_color,1.0);
if (touch2sit)
llSetClickAction(CLICK_ACTION_SIT);
else
llSetClickAction(CLICK_ACTION_NONE);
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
key user = llAvatarOnSitTarget();
if (llGetAgentSize(user) != ZERO_VECTOR)
{
integer access_granted = FALSE;
if (access_mode == 1)
access_granted = TRUE;
else if (access_mode == 2)
{
if (user == llGetOwner())
access_granted = TRUE;
else
{
llUnSit(user);
llSay(0," sorry, owner access only.");
}
}
else if (access_mode == 3)
{
if (llSameGroup(user))
access_granted = TRUE;
else
{
llUnSit(user);
llSay(0," sorry, group memeber access only.");
}
}
if (access_granted)
{
vector init_pos = llGetPos();
// warpPos(destination); // use warPos() function
posJump(destination); // use posJump() function
llUnSit(user);
llSleep(0.2);
// warpPos(init_pos); // use warPos() function
posJump(init_pos); // use posJump() function
}
}
}
}
}
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/ The script ends _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/