fancysilikon.blogg.se

Sl showhide on touch script
Sl showhide on touch script












sl showhide on touch script

sl showhide on touch script

if the animation is NOT being played, start it.My previous ShowHide and ShowHide-multi scripts have had quite a success as freebies, and someone asked me for a version which would fade in and out instead of brutally disappearing. List anims = llGetAnimationList( llGetOwner() ) get all animations being played on the owner of the object as keys check if the allowed avatar touched the object stores the key of an inventory animation to be playedĪnimation = llGetInventoryName(INVENTORY_ANIMATION,0) 8) //specify the key of the agent that you want to be the 'TOUCHER' I'm not sure if it works completely, and if it is the best way to do it, but worked for me. Then you may simply check whether your animation is on that list via if(llListFindList(anims, ) = -1) It returns a list of all animations (as keys, not names!) that are being played on the wearer right now. Script can detect whether a certain animation (with a certain key) is being played on the wearer via llGetAnimationList( llGetOwner() ). If(playing) means "if not playing" or the same as if(playing = FALSE)Īnd if I go even farther, there is a way you may get rid of playing variable and setting it manually everywhere. But those are integers that you only give the values of TRUE (1) or FALSE (0) ), it is much easier and shorter to put it that way:

sl showhide on touch script

Moreover, if you're working with so-called "boolean" values (LSL has no true booleans, only integers. So, in this case, else already means "if(playing = TRUE)", so there is no need to specify it again. No need to write it if(playing = FALSE)īecause "else" already means that whatever condition is in if is not true. LlRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION) Īnd a general recommendation.

#SL SHOWHIDE ON TOUCH SCRIPT CODE#

So, the working code is //specify the key of the agent that you want to be the 'TOUCHER' To make only the 'toucher' be "heard" by the touch event, simply put whatever there is in it into if(llDetectedKey(0) = TOUCHER) statement. But you want only the wearer to be animated, so you need to use llGetOwner() instead, because the wearer is always the owner of the object. So, your variant can be used as a dance machine that is attached to someone. That means that, no matter whether this object is worn by somebody or not, it will ask permission to animate from a toucher, not a wearer. One error you've made is that you ask for permission to animate from one who touched the object.

sl showhide on touch script

If I implement a permission system, how would I do that? Where in the code should I put it? Also, if I wanted the object to say or whisper something when clicked by the permitted person, how can I do that? I am also open to being directed to alternative scripts that get closer to what I want, if available and preferably modifiable. LlStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)) LlStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)) LlRequestPermissions(llDetectedKey(0),PERMISSION_TRIGGER_ANIMATION) Here's the script I currently have: integer playing In this case, I am not finding solutions. I have effectively no scripting experience so I just find scripts others made or haphazardly tinker. I already have a script which animates on touch but now I need to implement some kind of permission system. When clicked a second time, the animation stops. I would like to create an object that, when clicked by a specific person and only that person, it will animate the wearer of the object.














Sl showhide on touch script