Difference between revisions of "LlResetScript"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
(7 intermediate revisions by 5 users not shown)
Line 2: Line 2:
|func_id=163|func_sleep=0.0|func_energy=10.0
|func_id=163|func_sleep=0.0|func_energy=10.0
|func=llResetScript
|func=llResetScript
|func_footnote
|func_footnote=On script reset...
|func_desc=Resets the script
*The current event/function is exited without further execution or return.
*Any granted URLs are released.
*All global variables are set to their defaults
*The event queue is cleared.
*The [[default]] state is set as the active state
**If it has a [[state_entry]] event, then it is queued.
|func_desc=Resets the script.
|return_text
|return_text
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples
|examples=
<source lang="lsl2">
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()
    {
        ;
    }
}
</source>
|helpers
|helpers
|also_functions=*{{LSLG|llResetOtherScript}}
|also_functions=*{{LSLG|llResetOtherScript}}

Revision as of 14:30, 22 January 2015

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
  • 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();