State

LSL and OSSL feature states which scripts can define in many ways, switching back and forth between them using the state directive (example: state default;). States are defined using the keyword state (Example: state foo {…}) with the exception of the...

Return

A return is a value given when exiting a function or event. The return keyword is used for exiting from functions or events. If a function has a return value, all code paths will need to end in a return statement. Note: The term “return value” is used when...

Jump

jump label A jump is like a goto in other languages. Jumps can be used to alter normal flow control. When a jump occurs, script execution immediately moves to the next statement after the corresponding label definition, skipping intervening code and breaking out...

If-Else

Execute some statement(s) if a condition is true, else some other statement(s) if it is false. This is essentially the “bread and butter” of coding: the decision making inside a script. if (condition) statement else statement if (condition) {...

Do-While

 A do-while loop is similar to a while loop, but the order in which the parts are executed is different. Format do { statements } while (condition);   Example do { llSay(0, “monkey!”); } while (monkeysRemain()); This code will say...