Ask agent for permissions to run certain classes of functions.
void llRequestPermissions( key agent, integer permissions );
Forced delay: 0.0 seconds. Energy: 10.0.
Script execution continues without waiting for a response. When a response is given, a run_time_permissions event is put in the event queue.
| Constants | Action | Category | Granter | Automatically granted when… | |
|---|---|---|---|---|---|
| PERMISSION_DEBIT | 0x2 | take money from agent's account | Money | Owner | |
| PERMISSION_TAKE_CONTROLS | 0x4 | take agent's controls | Control | Anyone | sat on, attached |
| PERMISSION_TRIGGER_ANIMATION | 0x10 | start or stop Animations on agent | Animation | Anyone | sat on, attached |
| PERMISSION_ATTACH | 0x20 | attach/detach from agent | Attachment | Owner or Anyone | attached |
| PERMISSION_CHANGE_LINKS | 0x80 | change links | Link | Owner | |
| PERMISSION_TRACK_CAMERA | 0x400 | track the agent's camera position and rotation | Camera | Anyone | sat on, attached |
| PERMISSION_CONTROL_CAMERA | 0x800 | control the agent's camera (must be sat on or attached; automatically revoked on stand or detach) | Camera | Anyone | sat on, attached |
| PERMISSION_TELEPORT | 0x1000 | teleport the agent | Teleport | Anyone[1] | |
| PERMISSION_SILENT_ESTATE_MANAGEMENT | 0x4000 | manage estate access without notifying the owner of changes | Estate | Owner | |
| PERMISSION_OVERRIDE_ANIMATIONS | 0x8000 | configure the overriding of default animations on agent | Animation | Anyone | attached |
| PERMISSION_RETURN_OBJECTS | 0x10000 | Used by llReturnObjectsByOwner and llReturnObjectsByID to return objects from parcels | Cleanup | Owner, Group Owner | |
| PERMISSION_PRIVILEGED_LAND_ACCESS | 0x80000 | Grants the script privileged access to land parcel functions, such as parcel sale. Used by llSetParcelForSale. | Land | Owner | |
llRequestPermissions(AvatarID, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION)Request permission to animate an avatar
default
{
touch_start(integer detected)
{
llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llStartAnimation("sit");
llOwnerSay("animation will end in 5 seconds");
llSetTimerEvent(5.0);
}
}
timer()
{
llSetTimerEvent(0.0);
llStopAnimation("sit");
}
}
To request two (or more) permissions at the same time, use the bitwise OR (|) operator.
llRequestPermissions(AvatarID, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
integer perms = PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION;
llRequestPermissions(AvatarID, perms);
When an agent grants a script non-automatic permissions they will receive a notification (in chat) of
If the script that holds the permissions is in a child prim the name will be that of the child prim (not the object (root)) and position will be its local position (relative to its root).