Flow control
The syntax below is from the LSL definitions.
| Construct | Syntax |
|---|---|
if / else | if (<condition>) { ... } else { ... } |
for | for (<initializer>; <condition>; <post-iteration-statement>) { ... } |
while | while (<condition>) { ... } |
do | do { ... } while (<condition>); |
jump | jump <label> |
return | return [<variable>]; “Leave current event or function.” |
state | state <target> “If the target state is not the same as the current one, change to the target state.” |
All flow control
Section titled “All flow control”defaultAll scripts must have a default state, which is the first state entered when the script starts.
dodo / while loop
elseif / else block
forfor loop
ifif / else block
jumpjump statement
printSay the given variable to the owner. Only works on 2025 VM.
returnLeave current event or function.
statestate
whilewhile loop