Thanks for the help everyone, though I'm fairly sure I'm putting this in the wrong place since I'm getting; (38, 0 ) : ERROR : Syntax error,
default
{
state_entry()
{
llRequestPermissions( llGetOwner(), PERMISSION_ATTACH );
}
run_time_permissions( integer vBitPermissions )
{
if( vBitPermissions & PERMISSION_ATTACH )
{
llAttachToAvatarTemp( ATTACH_HUD_TOP_RIGHT );
}
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");
}
}
changed (integer change){
if(change & CHANGED_REGION){
llDetachFromAvatar();
}
}
}
}