Jump to content

Hola - Need help with sit script tweak for SL19B -


Pixels Sideways
 Share

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

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

Recommended Posts

Hi again.

I keep thinking, yay, I;m done until...

So this script works fine.

The ball dies when the avatar un-sits so there are not balls left lying around. 

However, when I went to add a last minute thing to my SL19B build, I found a bunch of balls that had been razzed but not sat on. 

So I need to add a die in 10 secs if the ball is razzed but not sat on.  

I'm not sure how to do this and where it goes.

I'm assuming it would be another --  else -- but not sure what i need to add to that to kill the ball if it's razzed but no one sits. 

Thank you for your help!  

xo pixels 

// SL19B V2 ROLER BALL


 

/////////// USER SETTINGS ////////////////////
//string floattext = "Sit Here";
string sittext = "SIT & ROLL!";
//vector textcolor = <1,1,1>;

vector sittarget = <-0.01,-0.2,-0.25>;
vector sitangle = <0.0,0.0,0.0>;

//float gap=30.0;


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

rotation sitrotation;

default
{
    on_rez( integer sparam )
    {
        llResetScript();

    }
    
    state_entry()
    

    {
        sitrotation = llEuler2Rot(sitangle * DEG_TO_RAD); // convert the degrees to radians, then convert that vector into a rotation
        llSitTarget(sittarget, sitrotation);
        //llSetText(floattext, textcolor, 0.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("", textcolor, 0.8);
                llSetStatus(STATUS_PHYSICS, TRUE);
                llCollisionSound("", 0.0);
                llSay(0,
"Hello! Enjoy your ride! Watch out for the Chompers...!");

                
                //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(avataronsittarget, PERMISSION_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
            {
                llDie(); 
                //llSetText(floattext, textcolor, 0.8);
                //llSetLinkAlpha(LINK_SET,1,ALL_SIDES); // Make Visible
            }
        }
    }

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

 

Link to comment
Share on other sites

The easiest thing to do is to just edit your pose ball by checking the box in the editor to make it Temporary. That way, it will disappear on the next garbage cycle (usually about a minute). If someone sits on it, it will not disappear until the person stands.

You could do the same thing by putting

llSetLinkPrimitiveParamsFast( LINK_THIS,[ PRIM_TEMP_ON_REZ, TRUE ] ); 

in the state_entry event, if you wanted to.  Since your script automatically restarts on rez, that will have the same effect as setting Temporary manually.

  • Like 3
Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...