Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: stand still!

Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
06-10-2003 19:32
CODE

// no mover
// Wednesday Grimm
// June 10, 2003
//
// This script makes physical objects stay still
// if this script is on an object attached to your avatar, you can't be
// pushed around
//
// THEY'RE NOT GOING TO PUSH YOU AROUND ANYMORE!!!
//

// True if we are staying still
integer nTarget;

// set up everything we need
startup()
{
// listen to the owner for a command
llListen(0, "", llGetOwner(), "");

// we are not staying still at startup
nTarget = FALSE;
llStopMoveToTarget();
}

default
{
state_entry()
{
startup();
}

on_rez(integer param)
{
startup();
}

listen(integer channel, string who, key id, string msg)
{
vector targetPos;
if (msg == "lock")
{
// if we are not already staying still, start doing it
if (nTarget == FALSE)
{
// where are we right now?
targetPos = llGetPos();
nTarget = TRUE;
llMoveToTarget(targetPos, 2.0);
}
}
else if (msg == "unlock")
{
// stop staying still
llStopMoveToTarget();
nTarget = FALSE;
}
}
}
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
04-25-2005 08:56
/15/58/3036/1.html
_____________________
i've got nothing. ;)