Control
From Second Life Wiki
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
Event: control( key id, integer level, integer edge ){ ; }Result of llTakeControls library function call and user input.
| |||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
Examplesdefault { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls( CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT | CONTROL_UP | CONTROL_DOWN | CONTROL_LBUTTON | CONTROL_ML_LBUTTON | 0, TRUE, TRUE); } } control(key id, integer level, integer edge) { integer start = level & edge; integer end = ~level & edge; integer held = level & ~edge; integer untouched = ~(level | edge); llOwnerSay(llList2CSV([level, edge, start, end, held, untouched])); } } | |||||||||||||||||||||||||||||||||
NotesllGetRot in mouselook for an attachment returns the angle the avatar is looking in. If llMinEventDelay is set to at least double this events delay, then this event will treat the llMinEventDelay as if it were half; in other words, this event can trigger twice as often as other events if the llMinEventDelay is greater than 0.1 My tests determined that the key returned when an agent control is caught is not the key for that agent, but is the object owner's key. If more then one script is used in the same object to hold permissions for multiple agents simultaneously, control may be triggered in all scripts but there is no way to know which agent actually caused the trigger. This has been filed as SVC-476 | |||||||||||||||||||||||||||||||||

