Jump to content

Recommended Posts

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 by Naiman Broome
Link to post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

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.)

  • Thanks 1
Link to post
Share on other sites

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 by Naiman Broome
Link to post
Share on other sites

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 post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...