Step 2: Running Your First Script

Traditionally one starts by writing the smallest program possible to print "hello world". Since LSL only runs inside objects, you must know how to create an object and put a script inside it.

You must be on land which allows building. Either your own land, or land where you have permission to build on such as a sandbox. Right click on the ground and choose "create". (for one button macs use command+click)

By default, you should see a "wand" icon with which you can click and create a cube on the ground.

You will automatically enter "edit" mode and an edit window will pop up.
(Note: to place a script in an existing object, right click it and hit edit to open the edit window.)

In the edit window you may see a button marked "more>>>" click it to reveal five tabs marked general, object, features, content, and texture. Click "content".

This window shows the contents of an object which can hold scripts, notecards, even other objects. Press "new script" to add a new script.

This will open the LSL editor with a default script. This editor will color code your syntax and provide some info about keywords when you hold your mouse over them. It will also do basic syntax checking.

Before explaining the code, lets run it. Hit "save" and close your edit window (not the LSL editor window).

You should see the words "Hello Avatar" from "object"

If you touch the object, it will say "Touched."
(make sure the "edit" building window is closed for touching to work.

Congratulations! You have compiled and run your first LSL script!