Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Die Lost_Die_Script  

Lost_Die_Script

Lost Die Script.lsl

Category: Die
By : ZHugh Becquerel
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Lost_Die_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Lost_Die_Script_1.lsl
1
2 //Title: Lost Die Script
3 //Date: 10-30-2003 06:53 AM
4 //Scripter: ZHugh Becquerel
5
6 float LastTimeOwnerDetected;
7 key owner;
8
9 TellOwner( string Message )
10 {
11 // llWhisper( 0, "Trace: " + Message );
12
13 llInstantMessage(owner, (string)llGetPos() + " " + Message );
14 }
15
16 Init()
17 {
18 owner = llGetOwner();
19 LastTimeOwnerDetected = llGetTimeOfDay();
20 llSetTimerEvent(10.0);
21 llSensorRepeat( "", "", AGENT, 50, PI, 10.0 );
22 }
23
24 SelfDestructNow()
25 {
26 llSay(0, "Too far from owner. Self-destructing...");
27 llInstantMessage(owner,"Too far from owner. Self-destructing...");
28 llDie();
29 }
30
31 default
32 {
34 {
35 Init();
36 }
37 on_rez(integer start_param)
38 {
39 Init();
40 }
41 timer()
42 {
43 if( llGetTimeOfDay() - LastTimeOwnerDetected > 60 )
44 {
45 //TellOwner( (string)llGetTimeOfDay() + " " + (string)LastTimeOwnerDetected );
46 SelfDestructNow();
47 }
48 else if( llGetTimeOfDay() - LastTimeOwnerDetected > 30 )
49 {
50
51 TellOwner( "Self destructing in 30 seconds..." );
52 }
53 }
54 sensor(integer num_detected)
55 {
56 integer i;
57 integer near_owner;
58 near_owner = FALSE;
59 for( i=0;i<num_detected;i++)
60 {
61 //TellOwner("Sensed:" + llDetectedName(i));
62 if( llDetectedKey(i) == owner)
63 {
64 //TellOwner( "You're close");
65 near_owner = TRUE;
66 }
67 }
68 if( near_owner == TRUE )
69 {
70 LastTimeOwnerDetected = llGetTimeOfDay();
71 }
72 }
73 }
74 // END //

Back to the Best Free Tools in Second Life and OpenSim.