mirror of
https://github.com/liftedpixel/lslscripts.git
synced 2026-08-14 00:58:07 +00:00
LL added llSetRegionPos, a basic sit TP script without warpPos
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//Set the description of the object this script is in
|
||||
//to the place you should teleported to (within the same region)
|
||||
//Like this: <84,20,58>
|
||||
//no sanity checking, script needs reset to update teleportPOS
|
||||
|
||||
vector homePOS;
|
||||
vector teleportPOS;
|
||||
|
||||
init() {
|
||||
homePOS = llGetPos();
|
||||
teleportPOS = (vector)llGetObjectDesc();
|
||||
llSitTarget(<1,1,1>, <0,0,0,0>);
|
||||
}
|
||||
|
||||
teleport() {
|
||||
llSetRegionPos(teleportPOS);
|
||||
llUnSit(llAvatarOnSitTarget());
|
||||
llSetRegionPos(homePOS);
|
||||
}
|
||||
|
||||
default {
|
||||
state_entry() { init(); }
|
||||
|
||||
changed(integer c) {
|
||||
if (c & CHANGED_LINK) {
|
||||
if (llAvatarOnSitTarget() != NULL_KEY) {
|
||||
llSetRegionPos(teleportPOS);
|
||||
llUnSit(llAvatarOnSitTarget());
|
||||
} else { llSetRegionPos(homePOS); }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user