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
Vehicles JetPack  

JetPack

JetPack

Category: Vehicles
By : Encog Dod
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for JetPack
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. JetPack_1.lsl
1 // From the book:
2 //
3 // Scripting Recipes for Second Life
4 // by Jeff Heaton (Encog Dod in SL)
5 // ISBN: 160439000
6 X// Copyright 2007 by Heaton Research, Inc.
7 //
8 // This script may be freely copied and modified so long as this header
9 // remains unmodified.
10 //
11 // For more information about this book visit the following web site:
12 //
13 // http://www.heatonresearch.com/articles/series/22/
14
15 default
16 {
18 {
20 }
21
22 attach(key id)
23 {
24 if(id)
25 {
26 state attached;
27 }
28 }
29 }
30
31 state attached
32 {
34 {
36 }
37
38 attach(key id)
39 {
40 if(id==NULL_KEY)
41 {
42 state default;
43 }
44 }
45
46 timer()
47 {
48 if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
49 {
50 state flying;
51 }
52 }
53 }
54
55 state flying
56 {
58 {
61 }
62
64 {
67 }
68 }
69
70 attach(key id)
71 {
72 if(id==NULL_KEY)
73 {
74 state default;
75 }
76 }
77
78 timer()
79 {
80 vector pos = llGetPos();
81 llSetText("Altitude: " + (string)pos.z, <0,1,0>, 1 );
82
83 if(!(llGetAgentInfo(llGetOwner()) & AGENT_FLYING) )
84 {
86 state attached;
87 }
88 }
89
90 control(key id, integer held, integer change)
91 {
92 if(held & CONTROL_UP)
93 {
95 }
96 else if(held & CONTROL_FWD)
97 {
98 rotation rot = llGetRot();
99 vector vel = llRot2Fwd(rot);
100
101 if( llGetAgentInfo(llGetOwner()) & AGENT_FLYING )
102 vel*=4;
103 else
104 vel/=2;
105
107 }
108 }
109 }

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