unpacked files
This commit is contained in:
33
TGAO/AttachScript.lsl
Normal file
33
TGAO/AttachScript.lsl
Normal file
@@ -0,0 +1,33 @@
|
||||
integer DefaultAttachPoint = ATTACH_HUD_CENTER_2;
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llRequestPermissions( llGetOwner(), PERMISSION_ATTACH );
|
||||
}
|
||||
|
||||
run_time_permissions( integer vBitPermissions )
|
||||
{
|
||||
if ( vBitPermissions & PERMISSION_ATTACH )
|
||||
llAttachToAvatar( DefaultAttachPoint );
|
||||
else
|
||||
llOwnerSay( "Permission to attach denied" );
|
||||
}
|
||||
|
||||
on_rez(integer rez)
|
||||
{
|
||||
if (!llGetAttached()) //reset the script if it's not attached.
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
attach(key id)
|
||||
{
|
||||
// The attach event is called on both attach and detach, but 'id' is only valid on attach
|
||||
if (id){
|
||||
llOwnerSay( "The object is attached to " + llKey2Name(id) );
|
||||
}else {
|
||||
llOwnerSay( "The object is not attached");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user