Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Self Deleting Prims

Numitor Allen
Registered User
Join date: 20 May 2007
Posts: 6
11-09-2007 01:15
Hi everybody,
i'd like to create a Script that deletes the Prims it contains after about 3 or 4 Minutes for an presentation.
I tried to make them disappear just like temporary prims but the amount of Time is way too short to explain the Folks the Project.

Does anyone know a way to make time this - or even is it possible?

Thanks in advance :)
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
11-09-2007 01:23
You're looking for a timer (llSetTimerEvent) and prim/object deletion (llDie), something like the following:

CODE

default
{
state_entry()
{
llSetTimerEvent( 4.0 * 60.0 );
// where (4.0 * 60.0) is the time in seconds to live for before deletion
}

timer()
{
llDie();
}
}
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Numitor Allen
Registered User
Join date: 20 May 2007
Posts: 6
11-09-2007 01:35
thanks a lot, worked like a charm :)
Zeppo Hitchcock
Registered User
Join date: 2 Feb 2007
Posts: 12
Yup
11-27-2007 08:37
Exactly what I needed too. Thanks!
CCTV Giant
Registered User
Join date: 2 Nov 2006
Posts: 469
11-27-2007 10:06
nand

Will that work kill the object if it is worn?

I am looking for basically the same thing but.......

The item cannot delete itself while it is worn

When said item is detached or dropped it will the start an irreversible countdown to deletion
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-27-2007 20:21
use the attach event and check to see if the av is wearing the item, if not start a timer to kill the item, if the av re-wears the item, kill the timer.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
11-28-2007 14:20
Attachments can't delete themselves, but you can simply have the attachment put itself into a useless state, something like:

CODE

state Dead {
on_rez(integer iParam) {
if (llGetAttached() == 0)
llDie();
else
llOwnerSay("Demo is up, please delete me!");
}
}


Some folks used to suggest to change the name of the object to something like "name (demo expired, delete)", but it seems like attachments aren't saving changes to names/descriptions on detach anymore, so I don't think that will work.