Pages

Tuesday, July 27, 2010

Remove inventory

Sometimes the solution to your problem is the easiest or most obvious. Whenever someone asks me about a problem, the first thing I usually ask is the most obvious answer, the kind of thing that makes you *facepalm* because it's so simple or right in front of your nose.

Someone asked me tonight wanting to know how to get more than one script to delete, including itself. The answer was simple, have the other scripts delete first, then have the script self destruct. Remember LSL reads top to bottom, left to right. So if you have one function before the other, the one on the topmost line will run first.
llRemoveInventory("New Script 1");
llRemoveInventory("New Script 2");
llRemoveInventory(llGetScriptName());

0 comments:

Post a Comment