Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sit

Daemon Speculaas
Gate Keeper
Join date: 2 Oct 2005
Posts: 14
01-22-2006 02:33
How do i make a script detect someone standing up from sitting on the object the script is in?
_____________________
Time dose not pass for the imortals.....
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
01-22-2006 02:41
The changed event. The example code has almost exactly what you are looking for, except backwards.
Daemon Speculaas
Gate Keeper
Join date: 2 Oct 2005
Posts: 14
tryed
01-22-2006 02:44
i know, i tryed and coulnd get it to work
_____________________
Time dose not pass for the imortals.....
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
01-22-2006 03:06
I dropped a copy on you in-game, but just so everyone can play:
CODE

// almost completely stolen from the LSL Wiki

string name;

default {
state_entry() {
llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work
}

changed(integer change) { // something changed
if (change & CHANGED_LINK) { // and it was a link change
if (llAvatarOnSitTarget() == NULL_KEY) { // somebody is no longer sitting on me
llSay(0, $name + " stood up");
} else {
name = llKey2Name(llAvatarOnSitTarget());
llSay(0, $name + " sat");
}
}
}
}