Who Is Online

3
Online

Monday, 19 November 2018 16:07

Sit on Animate

key owner;
key sitter;

string curanim;

default
{
    on_rez(integer params){llResetScript();}
    state_entry()
    {
    owner=llGetOwner();
     vector eul = <0,0,0>; //45 degrees around the z-axis, in Euler form
            eul *= DEG_TO_RAD; //convert to radians
            rotation quat = llEuler2Rot(eul); //convert to quaternion
            llSitTarget(<0,0,.2>,ZERO_ROTATION);
            llSetText("",<0,0,0>,1);
        }
            
    touch_start(integer total_number){
     
    }
    
     changed(integer change) { // something changed
     curanim=llGetInventoryName(INVENTORY_ANIMATION,0);
        if (change & CHANGED_LINK) { // and it was a link change
            llSleep(0.5); // llUnSit works better with this delay
            if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me
            sitter=llAvatarOnSitTarget();       
            llSleep(0.5);     
           llRequestPermissions(sitter, PERMISSION_TRIGGER_ANIMATION);
           llStopAnimation("sit");
           llStartAnimation(curanim);
            llSetAlpha(0,ALL_SIDES);
            }else{llStopAnimation(curanim);sitter=NULL_KEY;llSetAlpha(1,ALL_SIDES);}
        }
    }
} 

 

Flash Scratch to SL - Your Scripting Tool

Script ImageNeed to write a LSL script and don't know how to script?  I know I hate trying to get my head around LSLS when I an in a time crunch. So why not give Flash Scratch a try! Its a great tool for learning and scoding your own scripts for Second Life without having to pay someone to do it and without a crash course in LSL

A Huge thanks to John Bennet of ATLAS Institute at University of Colorado and Eric Rosenbaum at MIT for writing Scratch for SL to begin with.

Read more: Flash Scratch to SL - Your Scripting Tool