Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Animation | Franics | Sunbathing Script.lsl | |
Sunbathing Script.lsl
Sunbathing Script.lsl
Download this script - Please use this link to get this script. If you see all the code on one long line, please use Wordpad or another editor, such as LSLEdit.exe. The .LSL file you will download is an ordinary text file.
1 // CATEGORY:Animation 2 // DESCRIPTION:Sunbathing Script.lsl 3 // ARCHIVED BY:Ferd Frederix 4 5 // Francis wuz here 6 integer broadcast = 20; 7 8 // A More Neutral Sleeping Position 9 //vector target = <-1.06585, 0.71774, 0.18293>; 10 //rotation targetRot = <0.50028, -0.49972, -0.50028, 0.49972>; 11 12 // A More relaxed sleeping position 13 //vector target = <-1.15419, 0.56328, -0.25744>; 14 //rotation targetRot = <0.52105, -0.49829, -0.46875, 0.51038>; 15 vector target = <0,0,0.1>; 16 rotation targetRot = <0,0,0,1>; 17 21 22 integer time = 0; 23 default 24 { 25 state_entry() 26 { 27 llSetSitText( "Sunbathe" ); 28 llSitTarget( target, targetRot ); 29 if ( debugRotation ) { 32 } 33 } 35 if ( channel == 1977 ) 36 targetRot = (rotation) message; 37 else 38 target = (vector) message; 39 40 llSitTarget( target, targetRot ); 41 if ( time == 0 ) 43 time = (time +1) % 50; 44 } 46 if (change & CHANGED_LINK) 47 { 48 key agent = llAvatarOnSitTarget(); 50 // Someone new sitting down 51 sitAgent = agent; 52 llRequestPermissions(sitAgent,PERMISSION_TRIGGER_ANIMATION); 53 } 55 // sitting down person got up - wake up :) 56 if ( gotPermission ) { 57 llStopAnimation("hover"); 58 llStopAnimation("sit_to_stand"); 59 } 60 // Reset the script because we don't have a way of releasing permissions :) 61 llResetScript(); 62 } 63 } 64 } 65 run_time_permissions(integer parm) { 66 if(parm == PERMISSION_TRIGGER_ANIMATION) { 67 gotPermission = TRUE; 68 llStopAnimation("sit"); 69 llStartAnimation("hover"); 70 llStartAnimation("sit_to_stand"); 71 } 72 } 73 74 } 75 // END //