Skip to content
lsl.devlsl.devLSL Dev

llGetPermissions

function
Function syntax
integer llGetPermissions();
Returns
integer
Energy
10

Returns an integer bitfield representing the permissions (PERMISSION_*) currently granted to the script.

Returns an integer bitfield with the script permissions granted

How to use
integer result = llGetPermissions();
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
15 collapsed lines
default
{
state_entry()
{
llRequestPermissions(llGetOwner(),
//Comment out any of the following lines for fun
PERMISSION_DEBIT |
PERMISSION_TAKE_CONTROLS |
PERMISSION_TRIGGER_ANIMATION |
PERMISSION_ATTACH |
PERMISSION_CHANGE_LINKS |
PERMISSION_TRACK_CAMERA |
PERMISSION_CONTROL_CAMERA |
0);
}
touch_start(integer a)
{
integer perm = llGetPermissions();
if(perm & PERMISSION_DEBIT)
llOwnerSay("Can use llGiveMoney");
31 collapsed lines
if(perm & PERMISSION_TAKE_CONTROLS)
llOwnerSay("Can use llTakeControls");
if(perm & PERMISSION_TRIGGER_ANIMATION)
llOwnerSay("Can use llStartAnimation");
if(perm & PERMISSION_ATTACH)
llOwnerSay("Can use llAttachToAvatar");
if(perm & PERMISSION_CHANGE_LINKS)
llOwnerSay("Can use llCreateLink");
if(perm & PERMISSION_TRACK_CAMERA)
llOwnerSay("Can use llGetCameraPos");
if(perm & PERMISSION_CONTROL_CAMERA)
llOwnerSay("Can use llSetCameraParams");
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
llOwnerSay("Can use llGiveMoney");
if(perm & PERMISSION_TAKE_CONTROLS)
llOwnerSay("Can use llTakeControlls");
if(perm & PERMISSION_TRIGGER_ANIMATION)
llOwnerSay("Can use llStartAnimation");
if(perm & PERMISSION_ATTACH)
llOwnerSay("Can use llAttachToAvatar");
if(perm & PERMISSION_CHANGE_LINKS)
llOwnerSay("Can use llCreateLink");
if(perm & PERMISSION_TRACK_CAMERA)
llOwnerSay("Can use llGetCameraPos");
if(perm & PERMISSION_CONTROL_CAMERA)
llOwnerSay("Can use llSetCameraParams");
}
}
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. ↩