Write for us!
We pay you L$1000 for each of your submitted articles that we publish. Anyone can send in a contribution..
So you've heard of 'scripting' in Second Life, and you have a vague idea of what it is and what it's useful for, and you think you might be interested in learning how to do it, but you are unsure where to start. This series of articles is for you. In this, the first part, we look at how to create a script in Second Life.
Creating a Script
The first thing you'll need to know how to do is how to create a script object in the first place! There are only two places where you can create a script in Second Life: in your personal inventory, or in the inventory of an object you have created or have modify permissions for. Note, however that you can't run a script that is in your personal inventory; scripts can only be active when contained in and object. We'll start by showing you how to create a script in your inventory, where you can find it again later. In part two, we'll show you how to put a copy into an object and get it running. 
So, to create your first script, start by opening your inventory. Pick or create a folder to put the script in (the standard Scripts folder is a good choice!) Select that folder, then go to the Create menu at the top of the inventory window and select Create Script. You should see a new script object appear in your inventory, named "New Script" by default, with the name highlighted so you can call it whatever you want. You can open the script (by double-clicking it or by right-clicking and selecting Open from the menu) if you want to take a look at it, but don't worry if you don't understand it at this stage. What you have created is already a complete and ready to use script! It doesn't do very much, but we can put it into an object and see that it works. We'll do that in part two, but for now let's take a first look at the Script Edit window.
Editing Scripts
You can edit any script, assuming you have permission to do so, by simply opening it. To do so, either double-click the script in your inventory or right-click it and select "Open" from the pop-up menu. You should see the Script Edit window open. This is where you make changes to the script to determine what it does.
Most of the window is taken up by a text edit area containing the script itself. Just below that is a gray message area, which should be empty at the moment. Beneath that, at the bottom-right of the window, is a button labeled "Save". It's grayed out at the moment, because we haven't made any changes that need saving. As soon as you make changes to the script, the Save button will light up to indicate you need to save them. Let's try it...
Click in the main edit area, at the end of the line that reads "llSay(0, "Hello, Avatar!");" Hit enter to add a blank line (but don't type anything else yet). You should see the Save button light up; click it to save your changes. You should see two new lines in the message area, "Compile successful!" and "Save complete." If you make a mistake, you might see an error message instead. This is how Second Life tells you about any problems in your scripts. If you type "cool!" on the blank line you just created, then hit save again, you should see an example: a "syntax error" will be reported. The numbers at the start of the error message tell you what line and column the error was found at. Delete the whole line you just added, and hit Save again. If all went well, you'll have a success message again.
Conclusion
We haven't talked about how to get a script running yet. We'll cover that in part two. We also haven't described what this script will do when you run it, or how to go about making it do what you want. But don't worry, we're getting to that...! Read on to part two to continue.