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
Animation Sunbathing_Script  

Sunbathing_Script

Sunbathing Script.lsl

Category: Animation
By : Franics
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Sunbathing_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Sunbathing_Script_1.lsl
1
2 // Francis wuz here
3 integer broadcast = 20;
4
5 // A More Neutral Sleeping Position
6 //vector target = <-1.06585, 0.71774, 0.18293>;
7 //rotation targetRot = <0.50028, -0.49972, -0.50028, 0.49972>;
8
9 // A More relaxed sleeping position
10 //vector target = <-1.15419, 0.56328, -0.25744>;
11 //rotation targetRot = <0.52105, -0.49829, -0.46875, 0.51038>;
12 vector target = <0,0,0.1>;
13 rotation targetRot = <0,0,0,1>;
14
15 integer debugRotation = FALSE;
16 key sitAgent = NULL_KEY;
17 integer gotPermission = FALSE;
18
19 integer time = 0;
20 default
21 {
23 {
24 llSetSitText( "Sunbathe" );
25 llSitTarget( target, targetRot );
26 if( debugRotation ) {
27 llListen( 1977, "Rotation Broadcaster", NULL_KEY, "" );
28 llListen( 1978, "Rotation Broadcaster", NULL_KEY, "" );
29 }
30 }
31 listen(integer channel, string name, key id, string message ) {
32 if( channel == 1977 )
33 targetRot = (rotation) message;
34 else
35 target = (vector) message;
36
37 llSitTarget( target, targetRot );
38 if( time == 0 )
39 llSay(0, (string) targetRot + ", " + (string)target );
40 time = (time +1) % 50;
41 }
42 changed(integer change) {
43 if(change & CHANGED_LINK)
44 {
45 key agent = llAvatarOnSitTarget();
46 if( sitAgent == NULL_KEY && agent != NULL_KEY ) {
47 // Someone new sitting down
48 sitAgent = agent;
50 }
51 else if( sitAgent != NULL_KEY && agent == NULL_KEY) {
52 // sitting down person got up - wake up :)
53 if( gotPermission ) {
54 llStopAnimation("hover");
55 llStopAnimation("sit_to_stand");
56 }
57 // Reset the script because we don't have a way of releasing permissions :)
59 }
60 }
61 }
64 gotPermission = TRUE;
65 llStopAnimation("sit");
66 llStartAnimation("hover");
67 llStartAnimation("sit_to_stand");
68 }
69 }
70
71 }
72 // END //

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