Rotate Prim

Expired

default {
    state_entry() {
        llTargetOmega(<0,0,1>,PI/4,1);
    }
}

 

Poseball

Expired

string floattext = "";
string standanimation = "stand";
string sitanimation = "";

stop_all_animations () {
    list animationlist = llGetAnimationList(avatar);
    integer i;
    for (i = 0; i ,alpha);
    llStartAnimation(animation);
}                   

integer dance = TRUE;

key avatar;

default {
    state_entry() {
        floattext = llGetObjectDesc();
        sitanimation = llGetInventoryName(INVENTORY_ANIMATION,0);
        llSetText(floattext,<1 ,1,1>,1.0);
        llSetSitText("Pose!");
        llSitTarget(<0,0,0.1>,ZERO_ROTATION);
    }
    changed(integer change) {
        if (change & CHANGED_LINK) {
            if (llAvatarOnSitTarget() != NULL_KEY) {
                avatar = llAvatarOnSitTarget();
                integer perm = llGetPermissions();
                if (perm & PERMISSION_TRIGGER_ANIMATION && avatar == llGetPermissionsKey()) {
                    stop_all_animations(); 
                    start_animation(sitanimation,0.0);
                }
                else {
                    dance = TRUE;
                    llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
                }
            }
            else if(llGetPermissionsKey() != NULL_KEY){
                if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) {
                    stop_all_animations();
                    start_animation(standanimation,1.0);
                }
                else {
                    dance = FALSE;
                    llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
                }
            }
        }
    }
    run_time_permissions(integer perm) {
        if (perm & PERMISSION_TRIGGER_ANIMATION) {
            stop_all_animations();
            if (dance) {
                start_animation(sitanimation,0.0);
            }
            else {
                start_animation(standanimation,1.0);
            }
        }
    }
}   

 

Object Animation Script

Expired

//Written By Fuzionor Engawa of Fuzion Technologies
//Prepared and commented by Blazed Undercity of Fuzion Technologies

//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK
//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK

default
{
    state_entry()
    {
      vector mypos = llGetPos();   //gets the current position
      do{
          
//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK
          
llMoveToTarget(,2); //moves the object -1 meter on y axis
     llSleep(3);                                //waits 3 seconds to allow movement
 llMoveToTarget(,2);//moves the object 1 meter on y axis
     llSleep(3);                                //waits 3 seconds to allow movement

//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK
 
  //FOR UP AND DOWN MOTION USE THIS CODE
  // delete the '//' marks from in front of the code below.
  // put '//' marks in front of the 4 Purple codes above (llMoveToTarget and sleep)
  
  //       llMoveToTarget(,2);
 //           
//     llSleep(3);
//
  //       llMoveToTarget(,2);
 //           
//     llSleep(3); 
     
//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK
     
     ///////TIPS AND TRICKS///////
//You can use combinations of movement to achieve desired results

// Move the code into the touch start, so object moves when touched

//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK     
            }
while(1);
    }

    touch_start(integer total_number)
    {

    }
}


//OBJECT MUST BE PHYSICAL FOR ANIMATION TO WORK

 

Sword Deuling

Expired

integer SWORD = 1;
integer PUNCH12 = 2;
integer PUNCHL = 3;
integer KICK = 4;
integer FLIP = 5;

integer strike_type;

default
{
    state_entry()
    {
        llSetStatus(STATUS_BLOCK_GRAB, TRUE);
    }
    run_time_permissions(integer perm)
    {
        if (perm)
        {
                llTakeControls(CONTROL_ML_LBUTTON | CONTROL_LBUTTON | CONTROL_UP | CONTROL_FWD | CONTROL_BACK | CONTROL_ROT_LEFT | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_ROT_RIGHT | CONTROL_DOWN, TRUE, TRUE);
        }
    }
        
    attach(key on)
    {
        if (on != NULL_KEY)
        {
            integer perm = llGetPermissions();
            
            if (perm != (PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION))
            {
                llRequestPermissions(on, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
            }
            else
            {
                llTakeControls(CONTROL_ML_LBUTTON | CONTROL_LBUTTON | CONTROL_UP | CONTROL_FWD | CONTROL_BACK | CONTROL_ROT_LEFT | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_ROT_RIGHT, TRUE, TRUE);
            }
            
        }
        else
        {
            llSay(0, "releasing controls");
            llTakeControls(FALSE, TRUE, TRUE);
        }
    }
    
    timer()
    {
        if (  (strike_type == FLIP)
            || (strike_type == SWORD))
        {
            llSensor("", "", ACTIVE | AGENT, 4.0, PI_BY_TWO*0.5);
        }
        else
        {
            llSensor("", "", ACTIVE | AGENT, 3.0, PI_BY_TWO*0.5);
        }
        llSetTimerEvent(0.0);
    }
        
    control(key owner, integer level, integer edge)
    {
        if (level & (CONTROL_ML_LBUTTON | CONTROL_LBUTTON))
        {
            if (edge & CONTROL_UP)
            {
                llApplyImpulse(<0,0,3.5>,FALSE);
                llStartAnimation("backflip");
                llSetTimerEvent(0.25);
                strike_type = FLIP;
            }
            if (edge & CONTROL_FWD)
            {
                llStartAnimation("sword_strike_R");
                llSleep(0.5);
                llSetTimerEvent(0.25);
                strike_type = SWORD;
            }
            if (edge & (CONTROL_LEFT | CONTROL_ROT_LEFT))
            {
                llStartAnimation("punch_L");
                llSetTimerEvent(0.25);
                strike_type = PUNCHL;
            }
            if (edge & (CONTROL_RIGHT | CONTROL_ROT_RIGHT))
            {
                llStartAnimation("kick_roundhouse_R");
                llSetTimerEvent(0.25);
                strike_type = KICK;
            }
            if (edge & CONTROL_BACK)
            {
                llStartAnimation("punch_onetwo");
                llSetTimerEvent(0.25);
                strike_type = PUNCH12;
            }
            if (edge & CONTROL_DOWN)
            {
                llMoveToTarget(llGetPos(), 0.25);
                llSleep(1.0);
                llStopMoveToTarget();
            }
        }
    }
    
    sensor(integer tnum)
    {
        vector dir = llDetectedPos(0) - llGetPos();
        dir.z = 0.0;
        dir = llVecNorm(dir);
        rotation rot = llGetRot();
        if (strike_type == SWORD)
        {
            llTriggerSound("crunch", 0.5);
            dir += llRot2Up(rot);
            dir *= 20.0;
            llPushObject(llDetectedKey(0), dir, ZERO_VECTOR, FALSE);
        }
        else if (strike_type == PUNCH12)
        {
            llTriggerSound("crunch", 0.2);
            dir += dir;
            dir *= 20.0;
            llPushObject(llDetectedKey(0), dir, ZERO_VECTOR, FALSE);
        }
        else if (strike_type == PUNCHL)
        {
            llTriggerSound("crunch", 0.2);
            dir -= llRot2Left(rot);
            dir *= 20.0;
            llPushObject(llDetectedKey(0), dir, ZERO_VECTOR, FALSE);
        }
        else if (strike_type == KICK)
        {
            llTriggerSound("crunch", 0.2);
            dir += dir;
            dir *= 20.0;
            llPushObject(llDetectedKey(0), dir, ZERO_VECTOR, FALSE);
        }
        else if (strike_type == FLIP)
        {
            llTriggerSound("crunch", 0.2);
            llPushObject(llDetectedKey(0), <0,0,20>, ZERO_VECTOR, FALSE);
        }
        strike_type= 0;
    }
}