Bubble Gum

Written by Kitsune
//////////////////////////////////////////////////////////
// [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.              //
//////////////////////////////////////////////////////////
 
init() {
    llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    llPreloadSound("ff0600f0-d8f4-20f6-52ec-a03bc520fee3");
    llSetPos(<0,0,0>);
    llSetScale(<0,0,0>);
}
 
default
{
    on_rez(integer num) {
        if(llGetAttached()) init();
    }
    state_entry() {
        if(llGetAttached()) init();
    }
    attach(key id)
    {
        init();
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetTimerEvent(5 + (integer)llFrand(14));
        }
    }
 
    timer() 
    {
        llSetTimerEvent(0.0);
        llStartAnimation("express_kiss");
        float itra;
        for(itra=0.004; itra<0.06; itra+=0.004) { 
            llSetScale();
            llSetPos(llGetLocalPos()+<0.0007,0.0,0.0>);
 
        }
        llPlaySound("ff0600f0-d8f4-20f6-52ec-a03bc520fee3", 1.0);
        llStopAnimation("express_kiss");
        llSetScale(<0,0,0>);
        llSetPos(<0,0,0>);
        llSetTimerEvent(5 + (integer)llFrand(14));
    }
}