fxkmilo22 Posted April 8, 2013 Posted April 8, 2013 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 primdefault {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");} }}
Helium Loon Posted April 9, 2013 Posted April 9, 2013 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)
Rolig Loon Posted April 9, 2013 Posted April 9, 2013 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.
Recommended Posts
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