I found a script that I have placed a HUD. It was originally used to rezz fish, but I'm using it to rez pet demons. When I touch the HUD button, I can rez the objects placed within the HUD button. However, when I tried to delete the objects, they would not Die. I placed a ChatDie script in the rezzed object that would listen to anything say the correct command on the channel. This worked, but while I can now delete the rezzed objects, they always delete on their own even before I can hit the delete button on the HUD. If anyone can help me, I would really appreciate it.
Multi Object Rezzor Script
integer RADIUS_MAX = 9;
integer HEIGHT_MAX = 18;
float FREQ = 5; // how often to change target location
integer chanDlg;
integer chanFish = 10; // fish listen on this channel
integer numFish;
integer radius = 2; // radius around rezzer
integer height = 10; // max height of fish target -- meters relative to rezzer
integer lstn;
vector myPos;
vector target;
list fishTypes;
key owner;
vector chooseTarget()
{
myPos = llGetPos();
vector offset;
vector thisTarget;
offset.x = llFrand(2 * radius) - radius; // x/y offset can be negative
offset.y = llFrand(2 * radius) - radius;
offset.z = llFrand(height) + 0.5;
thisTarget = myPos + offset;
return thisTarget;
}
getFishTypes()
{
fishTypes = [];
integer i;
numFish = llGetInventoryNumber(INVENTORY_OBJECT);
for (i = 0; i < numFish; i++)
{
fishTypes += [llGetInventoryName(INVENTORY_OBJECT,i)];
}
}
init()
{
chanDlg = (integer)(llFrand(10000)+1000); // random chat channel to avoid interference
owner = llGetOwner();
if (lstn)
{
llListenRemove(lstn);
lstn = 0;
}
lstn = llListen(chanDlg,"", owner, ""
;myPos = llGetPos();
llOwnerSay("Click me to set the options."
;}
menu()
{
string txt = "SET UP THE Demons!\n\tMax height: "+(string)height+"m above rezzer\n\tHorizontal radius: "+(string)radius+"m";
list buttons = ["Radius -","Height -","DELETE","Radius +", "Height +"] + fishTypes;
llDialog(owner,txt,buttons,chanDlg);
}
rezFish(string name)
{
llOwnerSay("Summoning "+name+"."
;llRezObject(name, chooseTarget(), ZERO_VECTOR, ZERO_ROTATION, 0);
llSetTimerEvent(FREQ);
}
killFish()
{
llOwnerSay("Dismissing all nearby Demons."
;llSay(chanFish,"die"
;llSetTimerEvent(0);
}
default
{
state_entry()
{
init();
}
on_rez(integer num)
{
llResetScript();
}
touch_start(integer num)
{
getFishTypes();
integer i;
key agent = llDetectedKey(i);
if (agent == owner)
{
menu();
}
}
listen(integer channel, string name, key id, string message)
{
if (message == "DELETE"

{
killFish();
}
else if (message == "Radius +"
{
if (radius < RADIUS_MAX)
{
radius++;
}
else llOwnerSay("Radius is already at the maximum of "+(string)RADIUS_MAX+" meters."
;menu();
}
else if (message == "Radius -"

{
if (radius > 0)
{
radius--;
}
menu();
}
else if (message == "Height +"

{
if (height < HEIGHT_MAX)
{
height++;
}
else llOwnerSay("Height is already at the maximum of "+(string)HEIGHT_MAX+" meters."
;menu();
}
else if (message == "Height -"

{
if (height > 0)
{
height--;
}
menu();
}
else if (llGetInventoryType(message) >= INVENTORY_OBJECT) // returns -1 if object of that name doesn't exist
{
rezFish(message);
menu();
}
}
timer()
{
integer i;
for (i = 0; i < numFish; i++)
{
vector t = chooseTarget();
//target,<fish name>,<x>,<y>,<z>
llSay(chanFish,"target,"+llList2String(fishTypes,i)+","+(string)t.x+","+(string)t.y+","+(string)t.z); // tell fish where to swarm
}
}
}
DIE Chat Script placed in Rezzed Object
default
{
state_entry()
{
llListen(10,"",NULL_KEY,""
;}
listen(integer channel, string name, key id, string m)
{
if (m=="DELETE"
;llDie();}
}