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
Flight Assist Assisted_Flight  

Assisted_Flight

Here is a much requested script that enhances fly. Drop this script in any attachment that does not have a script in it (maybe your prim hair or something).

It enhances fly in two ways 1. you can fly as high as you like and you should not drift down (much, it is not perfect). 2. say the word "fly" and it changes into a much faster flying mode. In this mode you can also say "speed 30" to double your speed (or any number, default is 15). say "fly" again, or just stop flying to get out of this mode. One annoying bug, when in fast fly mode you will see "release keys" button. If you push it, your attachment comes off.

Category: Flight Assist
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Assisted_Flight
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Assisted_Flight_1.lsl
1 //ZeroFlight XLR8
2 //hacked together script by Burke Prefect, peices from other people's code.
3 //NOT RESPONSIBLE... FOR ANYTHING
4 float speed = 15; // this is starting speed.
5
6 set_hover() // this keeps you from falling at extreme altitudes. just 'fly' normally. works in either mode.
7 {
8 vector pos = llGetPos();
9 float ground = llGround(<0,0,0>);
11 {
12 if((pos.z > 75) && (pos.z > (ground + 35)))
13 {
14 llSetForce(<0,0,9.8> * llGetMass(), FALSE);
15 }
16 else
17 {
18 llSetForce(<0,0,0>, FALSE);
19 }
20 }
21 else
22 {
23 llSetForce(<0,0,0>, FALSE);
24 }
25 }
26
27 default // this is where the script starts off. it's not active, it's just waiting for a command.
28 {
30 {
31 key id = llGetOwner();
32 llListen(0,"",id,"");
35 }
36
37 timer()
38 {
39 set_hover();
40 }
41
42 listen( integer channel, string name, key id, string message ) {
43
44 if(message == "fly")
45 state freakpack;
46 }
47 }
48
49
50 //// By making 'freakpack' it's own state, we can control it much easier.
51 state freakpack
52 {
54 {
56 llListen(0,"",llGetOwner(),"");
58 }
59
60 // on_rez(integer total_number)
61 //{llResetScript();}
62
63 touch_start(integer total_number)
64 {
66 {
68 state default;
69 }
70 }
71
72 timer()
73 {
74 set_hover();
75 }
76
78 {
80 {
82 }
83 }
84
85 control(key av, integer level, integer edge)
86 {
87 if(level & CONTROL_UP)
88 {
89 llApplyImpulse(<0,0,speed*3>,FALSE);
90 }
91 if(level & CONTROL_DOWN)
92 {
93 llApplyImpulse(<0,0,-speed*3>,FALSE);
94 }
95 if(level & CONTROL_LEFT)
96 {
98 { llApplyImpulse(<0,speed,0>,TRUE);}
99 }
100 if(level & CONTROL_RIGHT)
101 {
103 {llApplyImpulse(<0,-speed,0>,TRUE);}
104 }
105 if(level & CONTROL_FWD)
106 {
108 {llApplyImpulse(<speed,0,0>,TRUE);}
109 }
110 if(level & CONTROL_BACK)
111 {
113 {llApplyImpulse(<-speed,0,0>,TRUE);}
114 }
115 }
116
117 timer()
118 {
120 set_hover();
121
122 else {
124 state default;
125 }
126 }
127
128 changed(integer change)
129 {
131 state default;
132 }
133
134 listen(integer channel, string name, key id, string m)
135 {
136 string ml = llToLower(m);
137 list parsed = llParseString2List(ml,[" "],[]);
138 if(llList2String(parsed,0) == "speed")
139 {
140 speed = (float)llList2String(parsed,1);
141 }
142 if(m=="fly")
143 {
145 state default;
146 }
147 }
148 }

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