I had the same problem almost:
I have built a school and i want to llRezzObject desks fror the schools inventory unlinked so avatars can sit on them:
I rezz the desks from a llDialog Menu in the school script building script
One of the options on the llDialog menu is to clear the rezzed Objects
I created a llSensorReapeat in in the prim desks thats senses when a further hidden object has been rezzed near the desks.
In the desks prim using llSensor llDies iteself I rezz the hidden phantom tranparrent object called "Die" its a temp prim with a small script that llDies it after 10 seconds
Here is the code for prim or linked prims you want to delete that was llRezzObject from another object
Prim linked desks
default
{
state_entry()
{
llSensorRepeat("Die","",SCRIPTED | PASSIVE,5,PI,5.0);
}
sensor(integer num)
{
\\ you can and maybe should add an llSensorRemove(); here
llDie();
}
no_sensor()
{
//add some debug code or sorthing else if not senced here
}
}
Here is the code for the hidden object that delets itself after so many seconds
Hidden prim Die:
default
{
state_entry()
{
llSleep(10.0);
llDie();
}
}
: