Table of Contents

About

This script was tested and works on OpenSim version 0.7.4!

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

Setup

Code

donut_dance.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, 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);
    }
}