Difference between revisions of "Self-Destruction"

From Second Life Wiki
Jump to navigation Jump to search
m (→‎Script: Changed <source> with <syntaxhighlight>)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL Header}}
Change the number in llSetTimerEvent('''30.0''') to set the time, in seconds, that it will take for the object to disappear.
Change the number in llSetTimerEvent('''30.0''') to set the time, in seconds, that it will take for the object to disappear.
==Script==
==Script==
<pre>// Davada Gallant (John Girard), WWIIOLers
<syntaxhighlight lang="lsl2">
// Davada Gallant (John Girard), WWIIOLers
// 30-second self destructor
// 30-second self destructor


Line 9: Line 12:
     {
     {
         //upon creation, immediately start the timer
         //upon creation, immediately start the timer
         ''llSetTimerEvent(30.0)'';
         llSetTimerEvent(30.0); // Change this to set time in seconds
     }
     }


Line 17: Line 20:
         llDie();   
         llDie();   
     }
     }
}</pre>
}</syntaxhighlight>
 
{{LSLC|Examples}}

Latest revision as of 03:00, 6 December 2023

Change the number in llSetTimerEvent(30.0) to set the time, in seconds, that it will take for the object to disappear.

Script

// Davada Gallant (John Girard), WWIIOLers
// 30-second self destructor

default
{
    state_entry()
    {
        //upon creation, immediately start the timer
        llSetTimerEvent(30.0); // Change this to set time in seconds
    }

    //once the timer ticks off, kill the object
    timer()
    {
        llDie();   
    }
}