3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Getting started in LSL scripting in Second Life

Step 2Running 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!
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
4
Followers
1
Author:Blueman
Hey all, this is Blueman Steele. I don't log in much now but want to try to put some of the many things I learned in Second Life here on this site.