I have this script which simply rezzes an object:
-------------------------------------------------------------
Text(string Message)
{
llSetText(Message, <1, 1, 1>, 3.0);
}
default
{
state_entry()
{
Text("Touch to Activate"
;}
touch_start(integer total_number)
{
llRezObject("prism_measure", llGetPos() + <-1.0,-1.0,0.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
}
}
------------------------------------------------------------------------------------------
When the object is rezzed this script is run it attaches to the avatar:
-------------------------------------------------------------------------------------------
default
{
state_entry()
{
llSetTimerEvent(.1);
llRequestPermissions( llGetOwner(), PERMISSION_ATTACH );
}
timer()
{
llSetText ((string)llGetPos(), <1.0, 1.0, 1.0>, 1.0);
}
run_time_permissions( integer vBitPermissions )
{
if (PERMISSION_ATTACH & vBitPermissions)
{
llAttachToAvatar( ATTACH_LHAND );
}
else
{
llOwnerSay( "Permission to attach denied" );
}
}
on_rez(integer rez)
{
if(!llGetAttached())
{ //reset the script if it's not attached.
llResetScript();
}
}
attach(key AvatarKey)
{
if(AvatarKey)
{//event is called on both attach and detach, but Key is only valid on attach
integer test = llGetAttached();
if (test) {
llOwnerSay( "The object is attached" );
} else {
llOwnerSay( "The object is not attached"
;llDie();
}
}
}
}
-----------------------------------------------------------------------------------------
This only seems to attach to my avatar not the avatar which activates the script any ideas where I have gone wrong?
