Difference between revisions of "LlResetScript"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
m (Specified what happens to timers/listeners)
Line 5: Line 5:
*The current event/function is exited without further execution or return.
*The current event/function is exited without further execution or return.
*Any granted URLs are released.
*Any granted URLs are released.
*All global variables are set to their defaults
*All global variables are set to their defaults.
*Timers (including repeating sensors) are cleared.
*Listeners are removed.
*The event queue is cleared.
*The event queue is cleared.
*The [[default]] state is set as the active state
*The [[default]] state is set as the active state.
**If it has a [[state_entry]] event, then it is queued.
**If it has a [[state_entry]] event, then it is queued.
|func_desc=Resets the script.
|func_desc=Resets the script.

Revision as of 12:45, 30 March 2020

Summary

Function: llResetScript( );

Resets the script.

On script reset...

  • The current event/function is exited without further execution or return.
  • Any granted URLs are released.
  • All global variables are set to their defaults.
  • Timers (including repeating sensors) are cleared.
  • Listeners are removed.
  • The event queue is cleared.
  • The default state is set as the active state.

Examples

default
{
    // reset script when the object is rezzed
    on_rez(integer start_param)
    {
        llResetScript();
    }

    changed(integer change)
    {
        // reset script when the owner or the inventory changed
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
            llResetScript();
    }

    // script initialization here
    state_entry()
    {
        ;
    }
}

See Also

Functions

Deep Notes

Search JIRA for related Issues

Signature

function void llResetScript();