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

Syntax

run_time_permissions( integer perm )

Event ID: 22.

Parameters

integer perm
mask of PERMISSIONS_* flags granting permissions

Constants

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 agentTeleportAnyone[1]
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

Examples

Plays an animation

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TRIGGER_ANIMATION & perm)
        {
            llStartAnimation("nyanya");
        }
    }
}

Notes

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.

Footnotes

  1. PERMISSION_TELEPORT cannot be held by temporary attachments.