Step 5Putting it all together
// All Scripts need a Default State
default
// this open curly bracket denotes the start of the state
{
state_entry() // an event
// another curly bracket starts the body of the event
{
llSay(0, "Hello, Avatar!"); // a function inside the event
}
// closed curly bracked closes the state_entry event
touch_start(integer total_number) // another event inside default state
{
llSay(0, "Touched."); // a function between the brackets of the touch_start body
}
// end of touch start
}
// Code end
The instant you save your script, it enters default state, which in turns runs the "state_entry" event which in turn runs the funciton llSay() which makes the object talk.
After this the program waits idle in the default state until a new event is called.
Touching the box triggers the even "touch_start" which also makes the object speak.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

































