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 RC_Script  

RC_Script

RC Script.lsl

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

the Zip file

Download all files for RC_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. RC_Script_1.lsl
1
2 key pilot = NULL_KEY;
3 string pilot_name = "";
4 integer controls_taken = FALSE;
5
6 set_pilot(key id, string name)
7 {
8 pilot = id;
9 pilot_name = name;
11 }
12
13 release_controls()
14 {
15 if(controls_taken) {
16 pilot = NULL_KEY;
17 controls_taken = FALSE;
19 }
20 }
21
22 move_by(vector offset)
23 {
24 llSetPos(llGetPos() + offset*llGetRot());
25 }
26
27 rotate_by(vector angular_offset)
28 {
29 llSetRot(llEuler2Rot(llRot2Euler(llGetRot()) + angular_offset * DEG_TO_RAD));
30 }
31
32 default
33 {
34 touch(integer num_touched)
35 {
36 //if(llDetectedKey(0) == llGetOwner()) {
37 set_pilot(llDetectedKey(0), llDetectedName(0));
38 //}
39 }
40
41 control(key name, integer level, integer edge)
42 {
43 if(level & CONTROL_FWD) {
44 move_by(<0,.5,0>);
45 }
46 if(level & CONTROL_BACK) {
47 move_by(<0,-.5,0>);
48 }
49 if(level & CONTROL_LEFT || level & CONTROL_ROT_LEFT) {
50 rotate_by(<0,0,1.5>);
51 }
52 if(level & CONTROL_RIGHT || level & CONTROL_ROT_RIGHT) {
53 rotate_by(<0,0,-1.5>);
54 }
55 if(level & CONTROL_UP) {
56 move_by(<0,0,.5>);
57 }
58 if(level & CONTROL_DOWN) {
59 move_by(<0,0,-.5>);
60 }
61 }
62
64 {
67 controls_taken = TRUE;
68 } else {
69 release_controls();
70 }
71 }
72 }
73 // END //

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