Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Attaching object to avatar that isn't the owner

Drue Aridian
U of Wash. LIFE Center
Join date: 10 Nov 2005
Posts: 2
05-11-2006 09:23
I want to be able to allow another user's avatar to be able to attach an object that I own (or is owned by a group we both belong to). When they try to attach the following object though, I get the message "script trying to attach to someone other than owner". I have read the wiki http://secondlife.com/badgeo/wakka.php?wakka=llAttachToAvatar
and don't understand the problem I have. When I run the script below, I get perm that says I do have permission to attach. See code below


If this doesn't work, How can I get another avatar to be able to attach an object without having to have them save them to their inventory first? Is there an easier way?

help and thanks!
Drue...

integer DEBUG = TRUE; // debug
string strName;
default {
touch_start(integer num_detected)
{
strName = llKey2Name(llGetKey()) ;
if (DEBUG == TRUE) llSay(0, "got to touch_start";);

llRequestPermissions(llDetectedKey(0), PERMISSION_ATTACH);
}

run_time_permissions(integer perm)
{

if (DEBUG == TRUE) llSay(0, "got to run_time permissions";);
if (DEBUG == TRUE) llSay(0, "permissions granted was: " + (string)perm);


if (perm & PERMISSION_ATTACH)
{
// gets to here - so permissions are granted? right?
if (DEBUG == TRUE) llSay(0, "Permission to attach is present";);
llAttachToAvatar(ATTACH_LHAND);
}

}

attach(key attached)
{

//Doesn't reach here
if (DEBUG == TRUE) llSay(0, "attach event reached";);
if(attached != NULL_KEY) // object has been attached
{
llShout(nAttachedChannel, "Wooden Stick Attached";);
}
else
{
llShout(nDetachedChannel, "Wooden Stick Unattached";);
}
}

}
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
05-11-2006 10:08
Pretty clearly from that error message, objects can't attach to any avatar but their owner. No exceptions. If you want to avoid them having to take the object into their inventory, set it for sale for $0, "sell original", so that they can essentially claim ownership of the object in-world, then they can wear it.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
05-11-2006 13:01
Just to expand on Lex' answer, you can't attach things by script or otherwise that you don't own.

This stops one, pretty obvious, personal griefing tactic. A doesn't like B, makes an object that tries to follow them around and attach to them every 0.1 s. B gets a "object would like to attach to you" type message every 0.1s (you can make it faster of course) and goes away in disgust. Making sure you can only attach to the owner from the outset just stops that dead in its tracks.