Jump to content

Attachment Script Help!!!


RyanJ89
 Share

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

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

Recommended Posts

Hello Good People,

I have scripted an object to wear when a certain group is active, but I want it to be able to wear it as long as they're in the group not just when it's active. My script is below help me please, I have a deadline to meet!

 

key allowed_group = "GROUP_UUID_HERE!";

default
{
    attach (key id)
    {
        llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
        list details = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
        key object_group = llList2Key(details, 0);
        if (id != NULL_KEY)
        {
            if (object_group != allowed_group)
            {
                llOwnerSay ("Access denied.");
                llRequestPermissions (id, PERMISSION_ATTACH);
            }
        }
    }
    run_time_permissions (integer permissions)
    {
        if (permissions & PERMISSION_ATTACH)
        {
            llDetachFromAvatar ();
        }
    }
    on_rez(integer permissions)
    {
        llDie();
    }
}

Link to comment
Share on other sites

There's no way to detect whether a person is in a group unless the group is active.  However, as written, your script only checks 

29 minutes ago, RyanJ89 said:

if (object_group != allowed_group)

when the object is being attached or detached.  Therefore, if the person attaches the object and then makes her group inactive, the script should not lose permissions. So, just tell anyone in the group to make the group active, wear the object, and then keep it attached as long as it is needed.   

Edited by Rolig Loon
typos. as always.
Link to comment
Share on other sites

I was told by someone that there's a way to script where you can rez an object and get the group from the land, then if they aren't in the group they cannot wear the item. Do you know if that's possible to work correctly?

Link to comment
Share on other sites

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