Don't click here unless you want to be banned.

LSL Wiki : llResetScript

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
llResetScript()

All variables are reset to their default values. All pending events are cleared. The default state becomes active and its state_entry is triggered. This is the same function as clicking "reset" in the script editor.

Note: It will cause the current event/function to exit without execution or return, so don't expect any statements following it within the same function to be executed. In other words, everything is aborted, and re-entered into the initial default state at state_entry.

It can be useful to include llResetScript in the on_rez event if the script uses llGetOwner and will be sold or distributed. This way, any listens set to the owner will reset when the object is rezzed by its new owner.

Compare with llResetOtherScript.

Q: My script isn't resetting when I rez it. What's going on?
A: Are you sure that you have llResetScript() in your on_rez event?

Q: How can I retain all the values in my variables and update llGetOwner while avoiding llResetScript?
A: Create a new function that removes and sets the llListen with llGetOwner. reference this function in state_entry and on_rez. This assigns a new owner to the listener but does not remove any data. Unlike llResetScript which resets the data.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Script | Reset
Comments [Hide comments/form]
What does this do to active llListens?
-- GordonPrior (2005-12-21 08:29:12)
Removes them.
-- ChristopherOmega (2005-12-21 10:22:16)
See comment in on_rez event about the use of llResetScript().
-- FremontCunningham (2007-04-13 13:47:05)
Why not update ownership by responding to the change() event and testing for (change & CHANGE_OWNER), and resetting any listens or global variables then? that seems the reliable and simple way!
-J Sprawl
-- c-24-22-165-193.hsd1.mn.comcast.net (2007-10-19 10:21:46)
Q: My script isn't resetting when I rez it. What's going on?
A: Are you sure that you have llResetScript() in your on_rez event?


I'd add: Are you sure that the "Running" checkbox is checked?
-- 195-5-95-34.usul.arrakis.es (2007-11-25 10:19:06)
Attach a comment to this page: