The Second Life scripting language is very powerful. It lets you add more functionality and interactivity to everything you build.

If you're a programmer or are familiar with other scripting languages, you'll have no trouble learning the Second Life scripting language. A complete reference to the scripting language can be found in the Help menu.

Even if you're not a programmer and you have no interest in learning to write scripts, you can still make use of them in your creations.

If you need something complex or special scriptwise, there will be people to write it for you -- for a certain amount of Linden Dollars.

But for simple things -- especially common ones like turning lights on and off -- there are scripts available for the taking. A number of useful scripts can be found in your Inventory.

A good way to get scripts is to copy them from objects that already have them. As you travel through your Second Life, you'll find things that you like, some of which have scripts that you can take.

When someone creates something, with or without a script, they can set the permissions either so people can or can't copy any or all of it. You'll no doubt find cool things that you can't copy, but many of things can be copied and you'll have access to copy the scripts, as well.

Obviously, the model lamp has exactly the script you need for your lamp. Let's take the script out, then add it to our new lamp.

The script you want is actually attached to the bulb of the model lamp. To access that single part, we'll first have to Unlink the lamp's parts.

1. Click on the model lamp to select it.

2. Open the Tools menu (the Tools menu at the top of the screen, not the Tool Palette) and select Unlink.

3. Click on the ground near the model lamp to unselect it, then click on the bulb.

4. Click on the Content tab of the Tool Palette.

You should see a couple of button sounds and a script called LightScript in the contents.

5. Drag the script into the Scripts folder of your Inventory.

6. Now, click on the bulb of your new lamp.

You should see an empty Contents tab in the Tool Palette.

7. Drag LightScript from the Scripts folder of your Inventory into the Contents folder in the Tool Palette.

The script is installed. It's that simple.

This script also plays sounds -- button clicks -- when the lamp turns on and off. So we'll also add those two sounds to the Contents folder (so the script can access them). We could have copied them from the other lamp, but since they're common sounds used by a number of things, they're already in your Inventory in the Sounds folder.

8. In your Inventory, open the Sounds folder, and drag both Button_click_down and Button_click_up into the Contents folder.

9. Close the Tool Palette to get out of Edit view.

10. Click on the bulb of your new lamp.

The bulb should turn off.

11. Click on it again.

The bulb turns on.

12. Hit Enter (Return) and type "off", and hit Enter again.

Again, the light turns off.

13. Hit Enter (Return) and type "on", and hit Enter again.

And again, the light turns on.

Next, let's take a look at a script and learn how we can easily modify it.

[ Advanced Skills Home | Creation 101 Home | Previous | Next ]