Top Free Scripts
Script ID : 32
Audience : Default
Version 1.00
Published Date: 2010/5/12 5:01:50
Reads : 11157
Animation

A simple and low lag poseball script. Add 1 animation to prim with script.

Add script and 1 animation to prim. Change settings at top of script.

Float Text and Prim will turn invisible while avatar is using

/////////// USER SETTINGS ////////////////////

string floattext "Sit Here";
string sittext "Pose!";
vector textcolor = <1,1,1>;

vector sittarget = <0,0,1>;
vector sitangle = <0.0,0.0,0.0>;

//////////// BEGIN SCRIPT ////////////////////

rotation sitrotation;

default
{
    
on_rezinteger sparam )
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
sitrotation llEuler2Rot(sitangle DEG_TO_RAD); // convert the degrees to radians, then convert that vector into a rotation
        
llSitTarget(sittargetsitrotation);
        
llSetText(floattexttextcolor0.8);
        
llSetSitText(sittext);
    }

    
changed(integer change)
    {
        if(
change CHANGED_LINK// If someone has sat on, or "linked," to this prim...
        
{
            
key avataronsittarget llAvatarOnSitTarget();
            if( 
avataronsittarget != NULL_KEY )    //Someone is sitting on the object
            
{
                
llSetText(""textcolor0.8);
                
llSetLinkAlpha(LINK_SET,0,ALL_SIDES); // Turn Invisible
                // Before animating, first check if we have permission to do so:
                
if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) {
                    
// If we do, we can animate:
                    
llStopAnimation("sit");
                    
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
                } else {
                    
// If we dont, ask for them:
                    
llRequestPermissions(avataronsittargetPERMISSION_TRIGGER_ANIMATION);
                    
// We'll animate in the run_time_permissions event, which is triggered
                    // When the user accepts or declines the permissions request.
                
}
            }
            else  
//stood up
            
{
                
llSetText(floattexttextcolor0.8);
                
llSetLinkAlpha(LINK_SET,1,ALL_SIDES); // Make Visible
            
}
        }
    }

    
run_time_permissions(integer perm)
    {
        if(
perm)
        {
            
llStopAnimation("sit");
            
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
        }
    }
}

0
|  Links 
Printer Friendly Page Send this Script to a Friend
Search for Help
New Product
Free Item
Sponsor

Site Info
Total Hits