Skip to content
lsl.devlsl.devLSL Dev

run_time_permissions

event
Event syntax
run_time_permissions(
  1. integer perm// Bitfield of currently granted permissions (PERMISSION_* flags). Values: ScriptPermission
) { … }

Triggered when an agent grants or denies runtime permissions requested by llRequestPermissions. Passes the active integer permissions bitfield perm (returns 0 if no permissions are currently granted).

Triggered when an agent grants run time permissions to this script.

How to use
run_time_permissions(integer perm)
{
}
ConstantsActionCategoryGranterAutomatically granted when…
PERMISSION_DEBIT0x2take money from agent’s accountMoneyOwner
PERMISSION_TAKE_CONTROLS0x4take agent’s controlsControlAnyonesat on, attached
PERMISSION_TRIGGER_ANIMATION0x10start or stop Animations on agentAnimationAnyonesat on, attached
PERMISSION_ATTACH0x20attach/detach from agentAttachmentOwner or Anyoneattached
PERMISSION_CHANGE_LINKS0x80change linksLinkOwner
PERMISSION_TRACK_CAMERA0x400track the agent’s camera position and rotationCameraAnyonesat on, attached
PERMISSION_CONTROL_CAMERA0x800control the agent’s camera
(must be sat on or attached; automatically revoked on stand or detach)
CameraAnyonesat on, attached
PERMISSION_TELEPORT0x1000teleport the agentTeleportAnyone1
PERMISSION_SILENT_ESTATE_MANAGEMENT0x4000manage estate access without notifying the owner of changesEstateOwner
PERMISSION_OVERRIDE_ANIMATIONS0x8000configure the overriding of default animations on agentAnimationAnyoneattached
PERMISSION_RETURN_OBJECTS0x10000Used by llReturnObjectsByOwner and llReturnObjectsByID to return objects from parcelsCleanupOwner, Group Owner
PERMISSION_PRIVILEGED_LAND_ACCESS0x80000Grants the script privileged access to land parcel functions, such as parcel sale. Used by llSetParcelForSale.LandOwner
PERMISSION_GAME_CONTROL0x100000Permission to receive game_control input events.ControlAnyonesat on, attached
Example 1
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}
run_time_permissions(integer perm)
{
if(PERMISSION_TRIGGER_ANIMATION & perm)
{
llStartAnimation("nyanya");
}
}
}

The argument perm is the bit combination of all permissions granted when this event is triggered. To determine if an exact permission is granted you will need to perform a bitwise AND comparison between perm and the permission constant you are looking for. The example above demonstrates this. Perm will be 0 if the user has refused to grant any permissions.

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

  1. PERMISSION_TELEPORT cannot be held by temporary attachments. ↩