Functions Defined
A function can be thought of as a machine into which input is provided, and which returns output. By using functions, the same blocks of code can be used over and over again, simply by referencing them.
LSL and OSSL come with hundreds of built-in functions that allow scripts and objects to interact with their environment. The built-in functions start with “ll” or “os”.
This example calls the llSay function which is used to send chat text to the specified channel.
llSay(0, "Hello world!");
The user can define functions (even with return values) as long as the name does not conflict with a reserved word, a built-in constant, or a built-in function.
Note: As LSL and OSSL have matured, several functions have been deprecated. Be sure to use the correct function since deprecated functions are unreliable and may be removed completely at a future date.
LSL Functions Status
Updated: October 28, 2014 using OpenSim-1a24b7f/r25290 (0.8-post-fixes)
The update will reflect ALL current LL-LSL Functions including those which are not supported in OpenSimulator.
These unsupported functions (notably Pathfinding etc) are there to show what is implemented & not.
Function | Implemented | Comments |
---|---|---|
llSetLinkAlpha | Yes | -2760 |
llSetLinkColor | Yes | -2760 |
llSetText | Yes | -2760 |
llGetLinkKey | Yes | -2754 |
llGetLinkName | Yes | -2754 |
llGetLinkNumber | Yes | -2754 |
llGetNumberOfPrims | Yes | -2754 |
llList2CSV | Yes | -2754 |
llList2Float | Yes | -2754 |
llList2Integer | Yes | -2754 |
llList2Key | Yes | -2754 |
llList2List | Yes | -2754 |
llList2Rot | Yes | -2754 |
llList2String | Yes | -2754 |
llList2Vector | Yes | -2754 |
llListenRemove | Yes | -2754 |
llListInsertList | Yes | -2754 |
llGetAndResetTime | Yes | -2750 |
llGetListLength | Yes | -2750 |
llGetRegionTimeDilation | Yes | -2750 |
llGetTime | Yes | -2750 |
llResetTime | Yes | -2750 |
llGetKey | Yes | -2688 |
llGetObjectDesc | Yes | -2688 |
llGetObjectName | Yes | -2688 |
llGetOwner | Yes | -2688 |
llGetPos | Yes | -2688 |
llGetRegionCorner | Yes | -2688 |
llGetRegionName | Yes | -2688 |
llGetRot | Yes | -2688 |
llGetScale | Yes | -2688 |
llGetSimulatorHostname | Yes | -2688 |
llGetUnixTime | Yes | -2688 |
llListen | Yes | -2688 |
llPow | Yes | -2688 |
llResetScript | Yes | -2688 |
llSetAlpha | Yes | -2688 |
llSetColor | Yes | -2688 |
llSetRot | Yes | -2688 |
llSetScale | Yes | -2688 |
llSetTexture | Yes | -2688 |
llSin | Yes | -2688 |
llSqrt | Yes | -2688 |
llTan | Yes | -2688 |
llVecNorm | Yes | -2688 |
llAbs | Yes | -2683 |
llAcos | Yes | -2683 |
llAsin | Yes | -2683 |
llAtan2 | Yes | -2683 |
llBase64ToString | Yes | -2683 |
llCeil | Yes | -2683 |
llDie | Yes | -2683 |
llFabs | Yes | -2683 |
llFloor | Yes | -2683 |
llFrand | Yes | -2683 |
llGetCreator | Yes | -2683 |
llGetDate | Yes | -2683 |
llGetGMTclock | Yes | -2683 |
llGetTexture | Yes | -2683 |
llGetTextureOffset | Yes | -2683 |
llGetTextureRot | Yes | -2683 |
llGetTextureScale | Yes | -2683 |
llOffsetTexture | Yes | -2683 |
llRotateTexture | Yes | -2683 |
llScaleTexture | Yes | -2683 |
llInstantMessage | Yes | 1 |
llCos | Yes | (2683) llSay(0,(string)llCos(100)); |
llWhisper | Yes | (2688) (but limited to 1023 chars) |
llShout | Yes | (2688) (limits 1023 chars) |
llSetPos | Yes | (2688) (now with limitation of 10m as in sl) |
llSetTimerEvent | Yes | (2688) (uses Timer plugin!) |
llSay | Yes | (2688)(limted to 1023 chars) |
llGetLocalPos | Yes | (2809) Reports parent pos in sim, not child |
llSetParcelMusicURL | Yes | (2826) Land update not sending changed streams to client. |
llPlaySound | Yes | (6879) Behavior varies among event handlers. |
llGiveInventory | Partial | (Does not send to avatars in other sims) |
llSetLinkPrimitiveParamsFast | Partial | * does not highlight like normal. (in connection to llGetLinkPrimitiveParams), together they rip linked prims apart when the item is worn. but not when it is dropped on the ground - PRIM_NORMAL, PRIM_SPECULAR and PRIM_ALPHA_MODE not yet implemented |
llEdgeOfWorld | Yes* | * Megaregion = No |
llAvatarOnLinkSitTarget | Partial | * Requires testing and Verification |
llCastRay | Partial | * Requires testing and Verification |
llClearLinkMedia | Partial | * Requires testing and Verification |
llClearPrimMedia | Partial | * Requires testing and Verification |
llDetectedTouchBinormal | Partial | * Requires testing and Verification |
llDetectedTouchNormal | Partial | * Requires testing and Verification |
llDetectedTouchUV | Partial | * Requires testing and Verification |
llGetDisplayName | Partial | * Requires testing and Verification |
llGetLinkMedia | Partial | * Requires testing and Verification |
llGetParcelMusicURL | Partial | * Requires testing and Verification |
llGetPrimMediaParams | Partial | * Requires testing and Verification |
llGetRegionAgentCount | Partial | * Requires testing and Verification |
llGetUsername | Partial | * Requires testing and Verification |
llManageEstateAccess | Partial | * Requires testing and Verification |
llRequestDisplayName | Partial | * Requires testing and Verification |
llRequestUsername | Partial | * Requires testing and Verification |
llSetPrimMediaParams | Partial | * Requires testing and Verification |
llSHA1String | Partial | * Requires testing and Verification |
llDetectedTouchST | Yes | * Tested in OpenSim 0.8.0 Dev |
llGetLinkPrimitiveParams | ** does not highlight like normal. together with llSetLinkPrimitiveParamsFast, they rip linked prims apart when the item is worn. but not when it is dropped on the ground - PRIM_NORMAL, PRIM_SPECULAR and PRIM_ALPHA_MODE not yet implemented | |
llGenerateKey | Yes | 0.7.4 onwards. From commit 9c2a73b61ef (30th April 2012) |
llSetObjectDesc | Yes | 100% implemented |
llSetObjectName | Yes | 100% implemented |
llGetColor | Partial | ALLSIDES returns default texture, not average, anything trying to grab more than 3 sides fails per example 2 |
llGetAlpha | Partial | ALLSIDES returns default texture, not sum, specific faces display correctly |
llGetEnergy | Partial | Always returns 1.0f |
llGetRegionFPS | Partial | Always returns 10.0f |
llMakeExplosion | Deprecated No | Deprecated |
llMakeFire | Deprecated No | Deprecated |
llMakeFountain | Deprecated No | Deprecated |
llMakeSmoke | Deprecated No | Deprecated |
llReleaseCamera | Deprecated No | Deprecated |
llSetPrimURL | Deprecated No | Deprecated |
llSound | Deprecated No | Deprecated |
llSoundPreload | Deprecated No | Deprecated |
llStopPointAt | Deprecated No | Deprecated |
llTakeCamera | Deprecated No | Deprecated |
llXorBase64Strings | Deprecated No | Deprecated |
llRemoteLoadScript | Deprecated No | Deprecated (from LSL Wiki) |
llSetStatus | Yes | Doesn't honor STATUS_BLOCK_GRAB STATUS_RETURN_AT_EDGE STATUS_SANDBOX |
llVolumeDetect | Yes | Implementation needs ODE to work, other physics engine only have a stub for this. Persistance of this feature (survive region restart) only implemented for SQLite. Semantics are slightly different to SL (switching off phantom via GUI also resets VolDet-status to off) |
llAgentInExperience | No | LL Experience Only. Not in OpenSimulator |
llCreateKeyValue | No | LL Experience Only. Not in OpenSimulator |
llDataSizeKeyValue | No | LL Experience Only. Not in OpenSimulator |
llDeleteKeyValue | No | LL Experience Only. Not in OpenSimulator |
llGetExperienceDetails | No | LL Experience Only. Not in OpenSimulator |
llGetExperienceErrorMessage | No | LL Experience Only. Not in OpenSimulator |
llKeyCountKeyValue | No | LL Experience Only. Not in OpenSimulator |
llKeysKeyValue | No | LL Experience Only. Not in OpenSimulator |
llReadKeyValue | No | LL Experience Only. Not in OpenSimulator |
llRequestExperiencePermissions | No | LL Experience Only. Not in OpenSimulator |
llUpdateKeyValue | No | LL Experience Only. Not in OpenSimulator |
llCreateCharacter | No | LL Pathfinding Only. Not in OpenSimulator |
llDeleteCharacter | No | LL Pathfinding Only. Not in OpenSimulator |
llEvade | No | LL Pathfinding Only. Not in OpenSimulator |
llExecCharacterCmd | No | LL Pathfinding Only. Not in OpenSimulator |
llFleeFrom | No | LL Pathfinding Only. Not in OpenSimulator |
llGetClosestNavPoint | No | LL Pathfinding Only. Not in OpenSimulator |
llGetStaticPath | No | LL Pathfinding Only. Not in OpenSimulator |
llNavigateTo | No | LL Pathfinding Only. Not in OpenSimulator |
llPatrolPoints | No | LL Pathfinding Only. Not in OpenSimulator |
llPursue | No | LL Pathfinding Only. Not in OpenSimulator |
llUpdateCharacter | No | LL Pathfinding Only. Not in OpenSimulator |
llWanderWithin | No | LL Pathfinding Only. Not in OpenSimulator |
llGetMass | Yes | May not be identical to main grid, due to different physics engine |
llListFindList | Yes | Needed for Kan-ed#11 |
llTakeControls | Yes | Needed for Kan-ed#12 |
llRequestPermissions | Yes | Needed for Kan-ed#12. |
llGetPrimitiveParams | Partial | Not available: PRIM_TYPE, PRIM_BUMP_SHINY, PRIM_FULLBRIGHT, PRIM_TEXGEN, PRIM_GLOW, PRIM_NORMAL, PRIM_SPECULAR, PRIM_ALPHA_MODE |
llTextBox | Yes | Operational with Viewers that support it. V3 and above all do. |
llGetObjectDetails | Partial | Params [OBJECT_RUNNING_SCRIPT_COUNT, OBJECT_TOTAL_SCRIPT_COUNT, OBJECT_SCRIPT_MEMORY] not working |
llSetLinkPrimitiveParams | Yes | Partial - PRIM_NORMAL, PRIM_SPECULAR and PRIM_ALPHA_MODE not yet implemented |
llSetPrimitiveParams | Yes | Partial (it seems complete but needed extensive checking. Also types in list are not LSL conformant) Blackdog Ashbourne: PRIM_POSITION doesn't seem to work - certainly doesn't allow for a warpPos implementation - PRIM_NORMAL, PRIM_SPECULAR and PRIM_ALPHA_MODE not yet implemented |
llGetSubString | Partial | Partially working. Just reports wrong position in strings. |
llGround | Yes | Partially... will not compile with llGetPos. |
llGetGeometricCenter | Partial | Physics engine reports as <0,0,0> currently |
llGetFreeMemory | No | Probably pointless to implement |
llGetAnimationOverride | No | Requires Implementation |
llGetMaxScaleFactor | No | Requires Implementation |
llGetMinScaleFactor | No | Requires Implementation |
llJson2List | No | Requires Implementation |
llJsonGetValue | No | Requires Implementation |
llJsonSetValue | No | Requires Implementation |
llJsonValueType | No | Requires Implementation |
llList2Json | No | Requires Implementation |
llResetAnimationOverride | No | Requires Implementation |
llSetAnimationOverride | No | Requires Implementation |
llGetEnv | No | Requires Implementation (Mar.01.2012) |
llGetMassMKS | No | Requires Implementation (Mar.01.2012) |
llGetMemoryLimit | No | Requires Implementation (Mar.01.2012) |
llGetSPMaxMemory | No | Requires Implementation (Mar.01.2012) |
llGetUsedMemory | No | Requires Implementation (Mar.01.2012) |
llScriptProfiler | No | Requires Implementation (Mar.01.2012) |
llSetAngularVelocity | No | Requires Implementation (Mar.01.2012) |
llSetContentType | No | Requires Implementation (Mar.01.2012) |
llSetKeyframedMotion | No | Requires Implementation (Mar.01.2012) |
llSetMemoryLimit | No | Requires Implementation (Mar.01.2012) |
llSetVelocity | No | Requires Implementation (Mar.01.2012) |
llTransferLindenDollars | No | Requires Implementation (Mar.01.2012) |
llGetStartParameter | Partial | Returns always 0! Same limitations as llSetStatus |
llGetLinkNumberOfSides | Yes | See LL's LSL wiki |
llEuler2Rot | Yes | Should work now. Someone who understands the math, please |
llParseString2List | Yes | Spacers are not parsed if separator list is empty |
llGetSunDirection | Yes | Sun fly on x axis and report 0 on zenith. Should fly on z axis and report 0 on horizon |
llDetectedLinkNumber | Yes | tested at 2011.01.25 on 0.7.1 Dev |
llGetHTTPHeader | Yes | tested at 2011.01.25 on 0.7.1 Dev with XEngine |
llVecDist | Yes | Tested in OpenSim 0.7.6 Dev |
llVecMag | Yes | Tested in OpenSim 0.7.6 Dev |
llHTTPResponse | Yes | Tested on 2011.01.25 with 0.7.1 Dev OS and xEngine |
llSetRegionPos | Yes | Tested on the Kitely and Avacon grids. |
llSleep | Yes | This function CAN lock script threads. This is a Partial Implementation. DO NOT USE! There are Mantii on it and it is a well known OpenSim buglet. |
llRemoveInventory | Yes | This function should be ported |
llGetNotecardLine | Partial | This is badly needed to read settings from notecards |
llGetAgentLanguage | Partial | Working as of 0.8.2.0 for local avatar only |
llGiveMoney | Yes | Works |
llSensorRemove | Yes | Works |
llSensor | Yes | Works beyond 96m 🙂 tested past 1000m |
llSensorRepeat | Yes | Works beyond 96m 🙂 tested past 1000m |
llRotLookAt | Yes | Works different than SL (better?) |
llSetBuoyancy | Yes | Works on free objects, does not make avatars buoyant with scripted attachments. The LSL wiki suggests using llSetPhysicsMaterial for better performance, but this is not implemented yet in OpenSim. |
llLoopSound | Yes | Works via UUID or Name, volume works too.. |
llRegionSay | Yes | Works with 1023 chars |
llRegionSayTo | Yes | Works with 1023 chars |
llRezObject | Yes | Works 🙂 |
llDialog | Yes | works, but appears on channel 0 as "User Name shouts: dialog message" instead of "User Name: dialog message". |
llDetectedKey | Yes | works. |
llDetectedName | Yes | works. |
llDetectedOwner | Yes | works. |
llDetectedPos | Yes | works. |
llDetectedType | Yes | works. |
llGetScriptName | Yes | works. |
llGetScriptState | Yes | Works. |
llSetScriptState | Yes | Works. |
llSetTouchText | Yes | Works. |
llTargetOmega | Yes | Works. |
llTriggerSound | Yes | Works. |
llUnSit | Yes | Works. |
llDetectedGrab | Partial | Z axis reads 100 + actual axis (was showing 129m when it was at 29m). |
llAddToLandBanList | Yes | |
llAddToLandPassList | Yes | |
llAdjustSoundVolume | Yes | |
llAllowInventoryDrop | Yes | |
llAngleBetween | Yes | |
llApplyImpulse | Partial | |
llApplyRotationalImpulse | No | |
llAttachToAvatar | No | |
llAttachToAvatarTemp | UnkNown | |
llAvatarOnSitTarget | Yes | |
llAxes2Rot | Yes | |
llAxisAngle2Rot | Yes | |
llBase64ToInteger | Yes | |
llBreakAllLinks | Yes | |
llBreakLink | Yes | |
llClearCameraParams | Yes | |
llCloseRemoteDataChannel | Yes | |
llCloud | Yes | |
llCollisionFilter | No | |
llCollisionSound | No | |
llCollisionSprite | No | |
llCreateLink | Yes | |
llCSV2List | Yes | |
llDeleteSubList | Yes | |
llDeleteSubString | Yes | |
llDetachFromAvatar | No | |
llDetectedGroup | No | |
llDetectedRot | Yes | |
llDetectedTouchFace | Yes | |
llDetectedTouchPos | Yes | |
llDetectedVel | Yes | |
llDumpList2String | Yes | |
llEjectFromLand | Yes | |
llEmail | Yes | |
llEscapeURL | Yes | |
llForceMouselook | Yes | |
llGetAccel | Yes | |
llGetAgentInfo | Partial | |
llGetAgentList | Yes | |
llGetAgentSize | Yes | |
llGetAnimation | Yes | |
llGetAnimationList | Yes | |
llGetAttached | No | |
llGetBoundingBox | Partial | |
llGetCameraPos | Yes | |
llGetCameraRot | Yes | |
llGetCenterOfMass | No | |
llGetForce | Yes | |
llGetFreeURLs | ||
llGetInventoryCreator | Yes | |
llGetInventoryKey | Yes | |
llGetInventoryName | Yes | |
llGetInventoryNumber | Yes | |
llGetInventoryPermMask | Yes | |
llGetInventoryType | Yes | |
llGetLandOwnerAt | Yes | |
llGetListEntryType | Yes | |
llGetLocalRot | Yes | |
llGetNextEmail | Yes | |
llGetNumberOfNotecardLines | Partial | |
llGetNumberOfSides | Yes | |
llGetObjectMass | Yes | |
llGetObjectPermMask | Yes | |
llGetObjectPrimCount | Yes | |
llGetOmega | Yes | |
llGetOwnerKey | Yes | |
llGetParcelDetails | Yes | |
llGetParcelFlags | Yes | |
llGetParcelMaxPrims | Yes | |
llGetParcelPrimCount | Yes | |
llGetParcelPrimOwners | Yes | |
llGetPermissions | Yes | |
llGetPermissionsKey | Yes | |
llGetPhysicsMaterial | ||
llGetRegionFlags | Yes | |
llGetRootPosition | Yes | |
llGetRootRotation | Yes | |
llGetSimStats | ||
llGetStatus | Yes | |
llGetTimeOfDay | Partial | |
llGetTimestamp | Yes | |
llGetTorque | No | |
llGetVel | Yes | |
llGetWallclock | Yes | |
llGiveInventoryList | Yes | |
llGodLikeRezObject | No | |
llGroundContour | Partial | |
llGroundNormal | Partial | |
llGroundRepel | No | |
llGroundSlope | Yes | |
llHTTPRequest | Yes | |
llInsertString | Yes | |
llIntegerToBase64 | Yes | |
llKey2Name | Yes | |
llLinkParticleSystem | Yes | |
llLinkSitTarget | Yes | |
llList2ListStrided | Yes | |
llListenControl | Yes | |
llListRandomize | Yes | |
llListReplaceList | Yes | |
llListSort | Yes | |
llListStatistics | Yes | |
llLoadURL | Yes | |
llLog | Yes | |
llLog10 | Yes | |
llLookAt | No | |
llLoopSoundMaster | No | |
llLoopSoundSlave | No | |
llMapDestination | Yes | |
llMD5String | Yes | |
llMessageLinked | Yes | |
llMinEventDelay | No | |
llModifyLand | Yes | |
llModPow | Yes | |
llMoveToTarget | Yes | |
llOpenRemoteDataChannel | Yes | |
llOverMyLand | Yes | |
llOwnerSay | Yes | |
llParcelMediaCommandList | Yes | |
llParcelMediaQuery | Yes | |
llParseStringKeepNulls | Yes | |
llParticleSystem | Yes | |
llPassCollisions | No | |
llPassTouches | No | |
llPlaySoundSlave | No | |
llPointAt | No | |
llPreloadSound | Yes | |
llPushObject | Yes | |
llRefreshPrimURL | No | |
llReleaseControls | Yes | |
llReleaseURL | Partial | |
llRemoteDataReply | Yes | |
llRemoteDataSetRegion | No | |
llRemoteLoadScriptPin | Yes | |
llRemoveFromLandBanList | Yes | |
llRemoveFromLandPassList | Yes | |
llRemoveVehicleFlags | No | |
llRequestAgentData | No | |
llRequestInventoryData | Yes | |
llRequestSecureURL | Partial | |
llRequestSimulatorData | Yes | |
llRequestURL | Yes | |
llResetLandBanList | Yes | |
llResetLandPassList | Yes | |
llResetOtherScript | Yes | |
llReturnObjectsByID | No | |
llReturnObjectsByOwner | No | |
llRezAtRoot | Yes | |
llRot2Angle | Yes | |
llRot2Axis | Yes | |
llRot2Euler | Yes | |
llRot2Fwd | Yes | |
llRot2Left | Yes | |
llRot2Up | Yes | |
llRotBetween | Yes | |
llRotTarget | No | |
llRotTargetRemove | No | |
llRound | Yes | |
llSameGroup | Yes | |
llScriptDanger | Yes | |
llSendRemoteData | Yes | |
llSetCameraAtOffset | Yes | |
llSetCameraEyeOffset | Yes | |
llSetCameraParams | Yes | |
llSetClickAction | Yes | |
llSetDamage | No | |
llSetForce | Yes | |
llSetForceAndTorque | No | |
llSetHoverHeight | Yes | |
llSetInventoryPermMask | No | |
llSetLinkCamera | No | |
llSetLinkMedia | ||
llSetLinkTexture | Yes | |
llSetLinkTextureAnim | Yes | |
llSetLocalRot | Yes | |
llSetObjectPermMask | Yes | |
llSetPayPrice | Yes | |
llSetPhysicsMaterial | ||
llSetRemoteScriptAccessPin | Yes | |
llSetSitText | Yes | |
llSetSoundQueueing | No | |
llSetSoundRadius | Yes | |
llSetTextureAnim | Yes | |
llSetTorque | No | |
llSetVehicleFlags | No | |
llSetVehicleFloatParam | Yes | |
llSetVehicleRotationParam | Yes | |
llSetVehicleType | Yes | |
llSetVehicleVectorParam | Yes | |
llSitTarget | Yes | |
llStartAnimation | Yes | |
llStopAnimation | Yes | |
llStopHover | Yes | |
llStopLookAt | No | |
llStopMoveToTarget | Yes | |
llStopSound | Yes | |
llStringLength | Yes | |
llStringToBase64 | Yes | |
llStringTrim | Yes | |
llSubStringIndex | Yes | |
llTarget | Yes | |
llTargetRemove | Yes | |
llTeleportAgent | Yes | |
llTeleportAgentGlobalCoords | Yes | |
llTeleportAgentHome | Yes | |
llToLower | Yes | |
llToUpper | Yes | |
llTriggerSoundLimited | No | |
llUnescapeURL | Yes | |
llWater | Yes | |
llWind | Yes | |
llXorBase64StringsCorrect | Yes |
Credit to: Lslwiki.net (not working), and Opensimulator.org with changes made for Brevity and clarity. Their license is here: https://creativecommons.org/licenses/by-sa/2.5/