From 40f8d85e6064072e743e2751164278c18d908b79 Mon Sep 17 00:00:00 2001 From: liftedpixel Date: Mon, 26 Mar 2018 17:08:36 -0700 Subject: [PATCH] LL added llSetRegionPos, a basic sit TP script without warpPos --- General/sittp.lsl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 General/sittp.lsl diff --git a/General/sittp.lsl b/General/sittp.lsl new file mode 100644 index 0000000..af0b5d3 --- /dev/null +++ b/General/sittp.lsl @@ -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); } + } + } +}