Jump to content

HELP!! script


fxkmilo22
 Share

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

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

Recommended Posts

Lo que deseo es dar a un avatar un objeto y q a su vez ejecute una animacion!!!

pero el problema es que solo lo permite en el avatar que lo creo, a los demas solo les ejecuta la animacion pero no les da el prim

default {
touch_start(integer num_detected) {
llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH);
// llRequestPermissions(llDetectedKey(0), PERMISSION_ATTACH);
}

run_time_permissions(integer perm) {
if (perm & PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH) {
llAttachToAvatar(ATTACH_RHAND);
llStartAnimation("pes1");

}
}

Link to comment
Share on other sites

While I don't understand the language you write in, I do understand LSL.  The script looks mostly correct.  I think the problem is that the "&" and "|" operators are equal in precedence, and so your condition in the run_time_permissions() event is evaluated left-to-right. 

 

Try changing:

 

if (perm & PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH) {

 

to

 

if (perm & (PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH)) {

 

though I'm not certain if that will work right, as run_time_permissions() events may be separate.  Better to change your event handler to something like:

 

run_time_permissions(integer perm) {    if (perm & PERMISSION_ATTACH) {        llAttachToAvatar(ATTACH_RHAND);    }    if(perm & PERMISSION_TRIGGER_ANIMATION) {        llStartAnimation("pes1");    }} 

 

 (edit:  Had the PERMISSION flags reversed)

Link to comment
Share on other sites

It wasn't clear to me on firsr reading either, but the OP's question is basically about how to make his object attach to and animate anyone who clicks it, not just its owner.  I spent some time in PM explaining how llAttachToAvatarTemp works and sent him a small demo object.

Link to comment
Share on other sites

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