Jump to content

Need pointed in right direction with script


Sumomo Cheri
 Share

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

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

Recommended Posts

Ok so im trying to script an object to detach when attached then when rezzed to the ground have object have its actions then die.

Tried  to make it die on attach and still follow the actions first but being attached keeps me from haing it die

Atm It  Detaches when attached but also does action of  on rez when attached and  dies when rezzed on ground


 If anyone knows how to tweak this so that it detaches with out triggering the on rez half till its actually rezzed on ground.

default
{
    attach(key AvatarKey)
    {
        if(AvatarKey)
        {
            llOwnerSay ("Cant be Worn.");
 
            llRequestPermissions(AvatarKey, PERMISSION_ATTACH );
        }
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_ATTACH)
        {
        llDetachFromAvatar( );
    }
}

    on_rez(integer param) {
        llTriggerSound("",1.0);

        llSay(0,"");
        llSleep(2);
       llDie();

    }

}

 

Link to comment
Share on other sites

Alright, I have put it in your example script.

default{    attach(key AvatarKey)    {        if(AvatarKey)        {            llOwnerSay ("Cant be Worn.");             llRequestPermissions(AvatarKey, PERMISSION_ATTACH );        }    }    run_time_permissions(integer perm)    {        if(perm & PERMISSION_ATTACH)        {            llDetachFromAvatar();        }    }    on_rez(integer param)     {        // Check if the object is attached. llGetAttached() returns 0 if object is not attached.        if (llGetAttached() == 0)         {                //Code between the stars will only execute if the object is not attached.        //**************************************            llTriggerSound("",1.0);                llSay(0,"");            llSleep(2);            llDie();        }        //**************************************    }}

 

Link to comment
Share on other sites

i see the 0 looks for no attachments i was trying all sorts of ways with that but that way   even tried  llGetattached () !=ATTACHED_RHAND) just out of randomess , as i said im very new to this all but willing to learn all i can and that really helped me alot.

Link to comment
Share on other sites

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