Flow Control

Flow control statements control when and where code is executed (how it flows). The following keywords are parts of LSL flow control. Keyword Purpose if-else Execute some statements if a condition is true, other statements otherwise. while Execute some statements as...

Functions

Functions Defined A function can be thought of as a machine into which input is provided, and which returns output. By using functions, the same blocks of code can be used over and over again, simply by referencing them. LSL and OSSL come with hundreds of built-in...

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) {...

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...

While

The statements in a while loop are executed over and over while a condition is met. Format while (condition) { statements } Note that if the condition is false initially, the statements will never be executed. Example This code will wait until it is at least 3600...