Donut Dance

From Second Life Wiki
Jump to: navigation, search

Created by Kira Komarov.

About

A script that Evilmorgan wanted me to create for her. It is a script that, along with an animation, should be placed in a dounut. Whenever you equip the donut, it says on the main channel and triggers a dance animation. Since I do not posess any good animations, the script is made to trigger the very first animation in the inventory.

Setup

  • Create a primitive - perhaps use a donut sculpt texture to make it into a sculpt.
  • Drop an animation along with the script below in the primitive you just created.
  • Take the primitive to your inventory and equip it to trigger the sequence.

Code

//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3              //
// Please see: http://www.gnu.org/licenses/gpl.html     //
// for legal details, rights of fair usage and          //
// the disclaimer and warranty conditions.              //
//////////////////////////////////////////////////////////
 
integer o = -1;
 
default
{
    attach(key id)
    {
        llSetTimerEvent(2);
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_TRIGGER_ANIMATION && llGetInventoryNumber(INVENTORY_ANIMATION)) {
            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, 0));
            llSetTimerEvent(5);
        }
    }
    timer() {
        if(o = ~o) {
            llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, 0));
            llDetachFromAvatar();
            llSetTimerEvent(0);
            return;
        }
        llSay(0, "Dimple donuts!!....nom nom nom");
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH);
        llSetTimerEvent(0);
    }
}