Triggered on any state transition and startup
state_entry()
Event ID: 0.
default
{
state_entry()
{
llSay(0,
"You either just saved the script after editing it"
+ "\nand/or the script (re)entered the default state.");
llSetText("Click to change states", <1.0, 1.0, 1.0>, 1.0);
}
touch_end(integer num_detected)
{
// Note: NEVER do a state change from within a touch_start event -
// - that can lead to the next touch_start on return to this state to be missed.
// Here we do the state change safely, from within touch_end
state two;
}
state_exit()
{
llSay(0, "The script leaves the default state.");
}
}
state two
{
state_entry()
{
llSay(0, "The script entered state 'two'");
state default;
}
state_exit()
{
llSay(0, "The script leaves state 'two'");
}
}