Jump to content

bubble gum script :: rezzed version ::


MIVIMEX
 Share

You are about to reply to a thread that has been inactive for 1023 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! I have a bubble gum script and I need to change it. I need to link the gum to the rezzed object, remove the animation for the avatar from it and leave only the effect of inflating the bubble and the sound of a pop. In general, so that the chewing gum worked for the rezzed object and not attached for the avatar. please tell me what needs to be changed! Thanks for help!

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(<itra,itra,itra>);
            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));
    }
}
 

Edited by MIVIMEX
Link to comment
Share on other sites

In general, such a script turned out. but I did not quite understand how. but it works. if someone explains I will be grateful.


default
{
    state_entry()
    {
        llSetTimerEvent(5.0); // timer 

    }
 

 
    timer()
    {

         float itra;
        for(itra=0.004; itra<0.06; itra+=0.004) { 
            llSetScale(<itra,itra,itra>);
            llSetPos(llGetLocalPos()+<0.0007,0.0,0.0>);
 
        }
 
 
         
         llSetScale(<0,0,0>);
         llPlaySound("ff0600f0-d8f4-20f6-52ec-a03bc520fee3", 1.0);

 
    }

}

 

Link to comment
Share on other sites

Every 5th second the timer is called.

The for-loop scales the bubblegum, making it bigger. Position of the bubblegum is moved upwards.

When the for-loop has finished, the bubble gum is scaled to zero, a sound is emitted.

Process repeats it self every 5th seconds.

Bug/missing in example: Remember to store initial bubblegum position and restore it, else the bubblegum will move over the head with time!

Happy chewing 😄

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1023 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...