// Trigger animation on attach // Just starts an animation when you attach an object, and stops it // when you detach it. // Ordinal Malaprop // 2006-06-18 // Change this name to the animation you want to run. // The named animation must be in the same prim as this script. // Make sure the name is EXACTLY the same! string gAnim = "animation name"; default { attach(key id) { // If we are being attached by the owner... if (id == llGetOwner()) { // ask for permission to start animations llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } // otherwise, if we are being detached and we can stop the // animation... else if (id == NULL_KEY && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // stop it llStopAnimation(gAnim); } } run_time_permissions(integer perms) { // If we got the right permissions... if (perms & PERMISSION_TRIGGER_ANIMATION) { // start the animation llStartAnimation(gAnim); } } }