list sitting_avatars = []; // List of UUIDs for seated avatars default { on_rez(integer _param) { llResetScript(); } changed(integer change) { integer TablePrims = llGetObjectPrimCount(llGetKey()); integer LinkedPrims = llGetNumberOfPrims(); integer i; key avkey; list tmp_sitting_avatars = []; string SitAnim = llGetInventoryName(INVENTORY_ANIMATION, 0); for (i = 0; i < LinkedPrims - TablePrims; i++) { avkey = llGetLinkKey(TablePrims + 1 + i); tmp_sitting_avatars += avkey; // Process avatars who have just sat if (llListFindList(sitting_avatars, [avkey]) == -1) { // Animate new sitters if an animation is present if (SitAnim != "") { llRequestPermissions(avkey, PERMISSION_TRIGGER_ANIMATION); llStopAnimation("sit"); llStartAnimation(SitAnim); } } } sitting_avatars = tmp_sitting_avatars; } }