Weekly Raffle
Top Free Scripts
ASD Web Tools
Poseball Script 2
 
Script ID : 32
Published Date: 2010/5/12 5:01:50
Reads : 6987
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));
        }
    }
}

Printer Friendly Page Send this Script to a Friend

Disclaimer: While I do not mind if these scripts are used in things you sell, I do not wish for these scripts to be sold either on their own or in script packs.
Now Available
Visit ASD Studios Hollywood
Search for Help
Monthly Free Item
Tip All Tip Chest


Limit one per avatar
Teleport Now!



Sponsor

Site Info
Total Hits: