This script deletes all scripts in an object, including itself.
// Delete all scripts in an object integer lhook; list scripts; alInit(integer argi) { if (lhook) { llListenRemove(lhook); } integer num = llGetInventoryNumber(INVENTORY_SCRIPT); integer i; for (i = 0; i < num; i = i + 1) { string tmps = llGetInventoryName(INVENTORY_SCRIPT,i); if (tmps != llGetScriptName()) { scripts = scripts + [ tmps ]; } } for (i = 0; i < llGetListLength(scripts); i = i + 1) { llRemoveInventory(llList2String(scripts,i)); } llRemoveInventory(llGetScriptName()); } default { on_rez(integer p) { // Reset, to get rid of stale listen handler. llResetScript(); } state_entry() { alInit(0); } }