QuietWren Posted December 21, 2020 Share Posted December 21, 2020 I'm making a script to add to existing chairs. It's supposed to note when a person sits on or unsits from the chair it's in, but for some reason it's only seeing the sit. Here is the snippet that is supposed to see the change: changed(integer change) { if (change == CHANGED_LINK) { llOwnerSay("The number of links has changed"); kSitter = llAvatarOnSitTarget(); if (kSitter == NULL_KEY) { llOwnerSay("Stand"); onStand(); } else { llOwnerSay("Sit"); onSit(); } } } This works correctly for sits, firing the correct OwnerSays, but on standing up from the chair it's silent. Could this be blocked from change events by other scripts in the chair? Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 21, 2020 Share Posted December 21, 2020 You can always test to see whether a person is sitting on the chair by asking if ( llGetAgentSize( llGetLinkKey( llGetNumberOfPrims() ) ) == ZERO_VECTOR ) Try that and see what happens. Meanwhile, don't write if (change == CHANGED_LINK) You should be testing by doing bitwise masking of change with CHANGED_LINK: if (change & CHANGED_LINK) 2 Link to comment Share on other sites More sharing options...
QuietWren Posted December 21, 2020 Author Share Posted December 21, 2020 Changing the change test to the mask fixed the problem Thanks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now