Run time permissions
From Second Life Wiki
| Languages: |
English • Deutsch • Español • ελληνικά • Français • עברית • Italiano • 日本語 • 한국어 • Nederlands • Magyar • Norsk • Dansk • Svenska • Türkçe • Polski • Português • Русский • украї́нська • 中文(简体) • 中文(繁體) |
| Volunteer translated pages are linked in blue, Google translated pages are linked in grey. Learn how to provide volunteer translations. | |
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Tutorials |
Description
Event: run_time_permissions( integer perm ){ ; }| 22 | Event ID |
Triggered when an agent grants run time permissions to task
| • integer | perm | – | mask of PERMISSIONS_* flags granting permissions |
| Constants | Action | Category | Granter | Automatic 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 | 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) | Camera | Anyone | sat on, attached |
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.
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.

