Don't click here unless you want to be banned.

LSL Wiki : Examples

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are


These are examples of LSL scripts you may find useful. For more, try the ScriptLibrary page or the Script Library forum on the Second Life website.

You may use these scripts freely as they stand, or as a base to build your own. Taking them and selling them would be considered impolite, however. If you want to use them in a "commercial" script, talk to the original author first.

Posting Guidelines:
Please preface new example script names with "Example", as in "ExampleAnimationScript". Also, put a return link to "Examples" at the end of the page. This makes it so if you click on this page's title, all the examples will come up. Remember to enclose your code using the "code" tags! (%% code goes here. %%)

Script Name: Purpose: Author:
Animation Basic quickly demonstrates the basics of animating an avatar CatherineOmega
Animation Script animates an avatar XylorBaysklef
Attachment Type Checker Checks if an object is attached, and where it's attached. CatherineOmega
Controls demonstrates the use of llTakeControls ReadyJack
Event Order says each event as it happens AngelaSalome
Get Root Position get link parent position from within child XylorBaysklef
Get Root Rotation get link parent rotation from within child XylorBaysklef
Gun a gun script that fires physical bullets ReadyJack
Link Message communicate between prims CatherineOmega
List Conversion convert lists to strings and back ReadyJack
Safe List Conversion converts lists to strings and back, with no possible errors KeknehvPsaltery
Look At looks at an agent JimBunderfeld
Money waits for payment and refunds invalid amounts CatherineOmega
Number Conversion charset/number system conversion EzharFairlight
ParticleScript creates particle effects AmaOmega
ParticleScript1 modified version EepQuirk
Point Child At Target point a selected axis of a child prim at a region-coordinate target CrossLament
Proximity Door controls access to an area JordanCotton
Self Replication demonstrates self replication StefanNilsson
States multiple states JimBunderfeld
States Concise 2-state script ChromalBrodsky
Argument Multiplexing argument multiplexing, eg for linkmessages HughPerkins
Left Or Right A function that returns whether one vector is to the left or right of another TiPBaKeR
RPC to PHP communicating with a PHP backend system MarcEisenberg
Browser/Object RPC Browser sends RPC request to SecondLife object and gets and shows response SomeScripter
ExampleHomeAlarmSystem How to write a home alarm system: monitor your SecondLife home from your browser in your FirstLife home, or on the go. SomeScripter
HUD Communication Allows a object only listen to your huds or you YiffyYaffle
Fixed Precision Truncate Floats to fixed precision GigsTaggart
32bit Hash Hash keys or strings into a 32 bit integer GigsTaggart
Authenticated Chat Autheticated Chat. GigsTaggart
Text to Leet Converts regular text into leet speak. Jadz0rConover
Text to Cap Alt Converts regular text into the capital alternation format. Jadz0rConover
ExamplellPushObject Throws an avatar in a specified direction. JokerOpus
Position on a Sphere Calculates the position on a sphere. AsiraSakai
Rotation to Vector/Angle Converts a rotation to a vector and the angle the vector is rotated around. AsiraSakai
Vector Gradient Enables one to transition smoothly from one vector to another, specially good for colors TigroSpottystripesKatsu
ExampleSides Numbers the sides of an object AnorcaCalamari
GetNewInventoryName Function that returns a list of names of items added to an object's inventory ZenMondo
llVector2String Function that returns a string form of a vector. VinceBosen
Unix2DateTime Function to convert Unix timestamp value to date/time value. HeusDens
IsValidKeyFormat Function to check wether a string is in a correct key format. HeusDens
IsValidFloatFormat Function to check wether a string is in a correct float format. HeusDens
SL Mail Script that allows you to sent and receive mail from within secondlife. HeusDens
ResellModule Full script that can be enhanced further to create a self-resellable item HeusDens
PHP Name2key A php function that returns the key to a name. GreblakWhitfield
Double Tap Detection An example on how to detect double taps without using timers. EyanaYohkoh
IsInteger Determines if string data passed to it is an integer or not. Useful when parsing notecard configurations, etc... Dachs Hax
AvatarInSim Detect if an avatar is in the same sim or not. SiRiSAsturias
MultiRound This function allows for easy rounding up or down of integers using mulitples. SiRiSAsturias
Tic Tac Toe A 6 step introduction to larger coding projects CoralGausman
SLURL Builder A function to return a usable SLURL KamilahHauptmann
llFibonacci A function to return a Fibonacci value SpiritHomewood
llCenter A function to center a string to a specified width SpiritHomewood
Q: What's the difference between the Script Library and the Examples page?
A: The Script Library is for full scripts. The Examples page is best suited for explaining specific functions, or parts of scripts.

HomePage | ScriptLibrary
There are 5 comments on this page. [Display comments/form]