Return
From Second Life Wiki
Second Life Wiki > Return (Redirected from LSL return)
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Tutorials |
- The correct title of this article is return. The initial letter is shown capitalized due to technical restrictions.
return value;
Used to return execution to the previous scope along with a value. Functions
Events
| |||||
return;Used to prematurely return execution to the previous scope before reaching the end of the function/event. You do not need to use this at the end of an event or function, as it is assumed by the compiler. Functions
Events
| |||||
Examplesinteger Goodbye() { llOwnerSay("Goodbye"); return 0; } Hello() { llOwnerSay("Hello"); return; } // Very great thanks to Darling Brody for helping me understand this. string WhoAreYou(key id) { return (llKey2Name(id)); // return the value established } default { touch_start(integer detected) { string name = WhoAreYou(llDetectedKey(0)); // store the name of the one who touched the object if(name != "Philip Linden") return; // leave the event because the toucher is not "Philip Linden" llSay(0, "OMG PHILIP LINDEN TOUCHED MA BOX!!!"); // just Philip Linden may read this // in case he's ever bored and tests this script } } | |||||

