Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Get position > set position

Thorne Kaiser
Nice Guy
Join date: 29 Nov 2005
Posts: 132
05-11-2006 08:00
How can I have one prim whisper it's position and have the second prim seti it's position the same as the first?
Sator Canetti
Frustrated Catgirl
Join date: 20 Sep 2005
Posts: 130
05-11-2006 08:56
I'll write this so you have to touch the first prim...

Prim 1 (I'll name this "Beacon";):

CODE
default
{
state_entry()
{

}

touch_start(integer total_count)
{
llWhisper(1, (string) llGetPos() );
}
}


Prim 2 (the moving one) (named anything):
CODE
default
{
state_entry()
{
llListen(1, "Beacon", "", "");
}

listen( integer channel, string name, key id, string message)
{
if (llGetOwnerKey(id) == llGetOwner()) //checks to make sure that you own it, so someone else doesn't disrupt your work
{
llSetPos( (vector) message );
}
}
}
_____________________
"Have gone to commit suicide. Intend to return from grave Friday. Feed cat." -- A memo by Spider Jerusalem in Transmetropolitan

"Some people are like Slinkies; not really good for anything, but they still bring a smile to your face when you push them down a flight of stairs."

If you're reading this signature, I've probably just disagreed with you. Welcome to the club :D