User:Marsbar9 Schomer/Test

From The SchomEmunity Wiki
Jump to: navigation, search

Mars' Userpage | Mars' Blog | User Talk | Mars' SPii Images | Forcibly reload

My understanding of Scripts

Introduction

Ok, so I am no expert on scripting, but I wanted to help people who are in my situation (never having scripted before SL!!!). Today I made my first ever script, even though it was the touch to say something (hello world) script. I'll add more to this as I go along, so keep coming back.

Starting off

This section breaks up a slightly modified touch to say something (hello world script) The very basic to making a script, is actually getting the interface to make it. To do this, go to inventory > create > new script. Rename this script and double click to open it. Next, you need to know that all scripts begin with the word default and then on the next line a {. All scripts end with a }.

So far you need to have the following:

default
{


}

So now you need to add the state - basically, what is this script going to do in this particular part? If you look below I have added in some common states - but there are hundreds! So we want the script to activate on touch, so we use

touch_start

Include this after the { in your script, and then (integer total_number)so you will now have:

default
{
    touch_start(integer total_number) 
}

You now need a { to say that part is over. Next, we want the script to make the object say something - and the state we use is

llSay

NOT FINISHED - OFF TO PLAY POPBALL WITH THE STAFF

Common States

Extras

My examples of Scripts

Additional links (both internal and external)