Feel free to skip this is you have no interest in scripting 🙂
When we script an object to rez another object, we tend to want to delete the rezzed object afterwards. There are a couple of ways to do this.
The first involves no script at all; you can rez the object marked as a temporary object, and some time in the next 120 seconds, the simulator code will delete it. This is great for very short lived things like bullets rezzed from a gun, but if you need the rezzed object to stick around until you decide to delete it, you need something else.
The naïve way to do it is to pre-load the object to be rezzed with a simple script that listens to the rezzer, and when it receives an appropriate message, it called llDie () to delete itself. This is simple, works, but has the downside of increasing the number of scripts in the object, which can negatively affect land impact.
I wrote a post a while back discussing how to delete an object by loading a script into it via llRemoteLoadScriptPin (). This avoids pre-loading a script; you load the script into the rezzed object when you want the object to delete itself. Unfortunately, this also has a downside. Because llRemoteLoadScriptPin () causes the calling script to sleep three seconds, it can be exceedingly slow to delete a large number of objects. It’s also far more complex to set up that the naïve way, but it does eliminate the possibility of increasing land impact with pre-loaded scripts.
Having struggled with this problem forever, scripters demanded a better method, and the Lab responded by defining a new function in a simulator release to delete rezzed objects: llDerezObject ().
Yay! Now instant deletes, no delays, no extra scripts required!
(I wrote this so I can link my old post mentioned above to it. If people find the old post then they also have the opportunity to discover this new and better method).