Naiman Broome Posted February 14, 2021 Share Posted February 14, 2021 (edited) Hello , I am looking for a script that allows me to rez poseballs in front of avatar when touch a weared object, can someone help me find one? I found this script in another thread default { touch_start(integer rand) // the interger doesn't matter at all, you can call it whatever you want, it's not used here { float number = (float) llFrand(llGetInventoryNumber(INVENTORY_OBJECT)); // determine the amount of the content and make a random float string name = llGetInventoryName(INVENTORY_OBJECT,(integer) number); //getting the name. the float number becomes integer for that llRezObject(name, llGetPos() + < 0, 0, 1 >, ZERO_VECTOR,ZERO_ROTATION, 0); //rezz the object, I just let it rezz 1m above the object } } It works for rezzing the objects, but I would like it to work when I am wearing the item , can it be done? Edited February 14, 2021 by Naiman Broome Link to comment Share on other sites More sharing options...
KT Kingsley Posted February 14, 2021 Share Posted February 14, 2021 It works as it is if you're wearing the object it's in. You may want to adjust the vector <0, 0, 1> a bit so that the rezzed objects don't push down on your avatar when they rezz. Link to comment Share on other sites More sharing options...
Naiman Broome Posted February 14, 2021 Author Share Posted February 14, 2021 I tried when dressed and doesnt work. Link to comment Share on other sites More sharing options...
KT Kingsley Posted February 15, 2021 Share Posted February 15, 2021 I tried it, too, and it did work. So, obvious questions first: are you on land where you're allowed to rez things, and does the land allow scripts to run? Is there something invisible getting in the way? Try right-clicking it and selecting "touch" from the menu. Put an extra line inside the touch_start event: llOwnerSay ("Touched"); (between the "{" and the "float"). Does that respond when you click? Oh, and is the script set to "running"? Link to comment Share on other sites More sharing options...
Naiman Broome Posted February 15, 2021 Author Share Posted February 15, 2021 It works only if I select, prss the wheel , to to ore , select touch and then works , but doesnt work on instatouch , which is what I was looking for, is it possible? Also could be possible to add a selfdetach so that after rezzing something it goes into inventory? Link to comment Share on other sites More sharing options...
KT Kingsley Posted February 15, 2021 Share Posted February 15, 2021 Ah, is the object rigged mesh clothing? As far as I know you can't instatouch worn rigged objects, and have to go through the menu. I think you're going to have to use a transparent unrigged prim or mesh, shaped to match (roughly) the rigged clothing, and linked to it. The unrigged prim should react to instatouches. You'll wear the link set on an attachment point where you can get the linked unrigged prim into a position that matches the rigged item. An item can detach itself automatically using the function llDetachFromAvatar. For that to work the script needs to get permission using the function llRequestPermissions with the parameter PERMISSION_ATTACH beforehand. default { state_entry () { llRequestPermissions (llGetOwner (), PERMISSION_ATTACH); //dialog if not worn, automatic if worn } touch_end (integer count) { //Rezzing stuff here llDetachFromAvatar (); } } (I've used the touch_end event here because touch_start was being a bit unreliable.) When you link the rigged item with the unrigged prim you should make the rigged item the root, and the script should go in the root. (At least, that's what worked for me when I tried it out just now.) 1 Link to comment Share on other sites More sharing options...
Naiman Broome Posted February 15, 2021 Author Share Posted February 15, 2021 (edited) I did this : default { state_entry () { llRequestPermissions (llGetOwner (), PERMISSION_ATTACH); //dialog if not worn, automatic if worn } touch_end (integer count) { //Rezzing stuff here { float number = (float) llFrand(llGetInventoryNumber(INVENTORY_OBJECT)); // determine the amount of the content and make a random float string name = llGetInventoryName(INVENTORY_OBJECT,(integer) number); //getting the name. the float number becomes integer for that llRezObject(name, llGetPos() + < 2, 0, -1 >, ZERO_VECTOR,ZERO_ROTATION, 0); //rezz the object, I just let it rezz 1m above the object } llDetachFromAvatar (); } } but it gives me syntax error. Edited February 15, 2021 by Naiman Broome Link to comment Share on other sites More sharing options...
KT Kingsley Posted February 15, 2021 Share Posted February 15, 2021 Hmm, I tired that myself (copied from your post and pasted into a new script in a newly created cube) and it compiled (saved) without errors. I can only guess, but perhaps there's an extra character somewhere in the script you copied the post from that slipped through? Link to comment Share on other sites More sharing options...
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