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

LSL Wiki : llResetScript

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are 38.107.191.112
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
There are 5 comments on this page. [Display comments/form]