| EASY LONG DISTANCE TELEPORTER |
|
|
description like: < 120,34,28 > texture the object the way you like.
vector gTargetPos; string gSitText="Teleport"; integer myChannel = 123; list objectD; string locationN; string gTargetPos1; integer ii = 0; vector gStartPos; key gAvatarID=NULL_KEY; integer gReturnToStartPos=TRUE; warpPos( vector destpos) { integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1; if (jumps > 100 ) jumps = 100; list rules = [ PRIM_POSITION, destpos ]; integer count = 1; while ( ( count = count << 1 ) < jumps) rules = (rules=[]) + rules + rules; llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) ); } default { state_entry() { objectD = llGetObjectDetails(llGetKey(), [OBJECT_DESC,OBJECT_NAME] ); gTargetPos1 = llList2String(objectD,0); gTargetPos = (vector)gTargetPos1; locationN = llList2String(objectD,1); gStartPos = llGetPos(); llSetSitText(gSitText); llSitTarget(<0,0,1>,ZERO_ROTATION); } on_rez(integer startup_param) { llResetScript(); } touch_start(integer nr) { if(llDetectedKey(0)==llGetOwner()){ ii += 1; llSetTimerEvent(5); if(ii<2) llInstantMessage(llGetOwner(),"Right click me to teleport to "+locationN+ "\n =Or touch me 2 times to update locations.="); if ( ii > 1){ llInstantMessage(llGetOwner(),"Updating Locations"); llResetScript(); } } else{ llInstantMessage(llDetectedKey(0),"Right click me to teleport to "+locationN); } } timer() { ii=0; llSetTimerEvent(0); } changed(integer change){ if(change & CHANGED_LINK) { gAvatarID = llAvatarOnSitTarget(); if(gAvatarID != NULL_KEY) { llSetAlpha(0.0,ALL_SIDES); warpPos(gTargetPos); llSleep(1); llUnSit(gAvatarID); llSleep(1); if (gReturnToStartPos) { // ... send object to its start position warpPos(gStartPos); llSetAlpha(1.0,ALL_SIDES); } } } } }
|
Show (0) - Add comments:

This teleporter is to teleport to one location.