Jump to content

onclick disappear object


XbabylonX
 Share

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

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

Recommended Posts

Hello, since im noob on these, I manages today to to click on an object in order to rez a poseball.

Now I want to "kill" that poseball by clicking a different object.

I searched about unrez trigger but says its unavailable.

What is the solution for that?

Thank you.

Link to comment
Share on other sites

let me see if I understand correctly:

  • you click object A
  • object B gets rezzed as a result
  • now you click object C
  • object B gets unrezzed

What you need to do is use llDie() - it can, however only caled from within the object that dies. What you need, thus, is a way to communicate: C has to tell B that it got touched. Look at llSay, llListen() and listen

I hope that will help you.

Link to comment
Share on other sites

In that case, in the changed event, where you have your test to see if someone is sitting on the object, just add the reverse test ...

 

else if(!AvatarOnSitTarget()){    llDie();}

 Or, since you want to kill the other object, send your kill message to it from that if test.

 

Link to comment
Share on other sites

Ok this is what I used on poseball

string animation; // Variable to store the name of the animation.string text = "Sit"; // Enter the float text here.default{    //Initialize    state_entry()    {        llSitTarget(<0,0,0.7>, ZERO_ROTATION); // Set's the sit target position and rotation. Don't set the first param to <0,0,0> because that will cause llAvatarOnSitTarget to fail.        llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); // Make object phantom so people don't trip over it        llSetAlpha(1.0, ALL_SIDES); // Initialize the object's alpha to visible        llSetText(text, <0,0,1>, 1.0); //Set the float text and make it visible    }    // Called when an agent sits or unsits    changed(integer change)    {        if(change & CHANGED_LINK)        {            if(llAvatarOnSitTarget() != NULL_KEY) // Makes sure there is a key from the avatar            {                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); // If so, request perms to play anim.            }            else //If not (Key is null) then agent unsat. Stop animation, make object visible, make float text visible            {                integer perm=llGetPermissions();                     llStopAnimation(animation);                llSetAlpha(1.0, ALL_SIDES);                llSetText(text, <0,0,1>, 1.0);            }        }    }       // Called when permission to play anim are requested    run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION)        {                llStopAnimation("sit"); // Stop the default sit animation                animation=llGetInventoryName(INVENTORY_ANIMATION,0); // Get the name of the animation in the object inventory                llStartAnimation(animation); // Start the found animation                llSetAlpha(0.0, ALL_SIDES); // Make oject tranparent                llSetText(text, <0,0,1>, 0.0); // Hide the float text        }    }} 

 

 

 

Link to comment
Share on other sites

just change the else case in the changed event:

string animation; // Variable to store the name of the animation.string text = "Sit"; // Enter the float text here.default{    //Initialize    state_entry()    {        llSitTarget(<0,0,0.7>, ZERO_ROTATION); // Set's the sit target position and rotation. Don't set the first param to <0,0,0> because that will cause llAvatarOnSitTarget to fail.        llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); // Make object phantom so people don't trip over it        llSetAlpha(1.0, ALL_SIDES); // Initialize the object's alpha to visible        llSetText(text, <0,0,1>, 1.0); //Set the float text and make it visible    }    // Called when an agent sits or unsits    changed(integer change)    {        if(change & CHANGED_LINK)        {            if(llAvatarOnSitTarget() != NULL_KEY) // Makes sure there is a key from the avatar            {                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); // If so, request perms to play anim.            }            else //If not (Key is null) then agent unsat. Stop animation, make object visible, make float text visible            {                integer perm=llGetPermissions();                     llStopAnimation(animation);                //llSetAlpha(1.0, ALL_SIDES);                //llSetText(text, <0,0,1>, 1.0);                llDie();            }        }    }       // Called when permission to play anim are requested    run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION)        {                llStopAnimation("sit"); // Stop the default sit animation                animation=llGetInventoryName(INVENTORY_ANIMATION,0); // Get the name of the animation in the object inventory                llStartAnimation(animation); // Start the found animation                llSetAlpha(0.0, ALL_SIDES); // Make oject tranparent                llSetText(text, <0,0,1>, 0.0); // Hide the float text        }    }} 

 that should do the trick

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4550 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...