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 Physics_Watcher_Script  

Physics_Watcher_Script

Physics Watcher Script.lsl

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

the Zip file

Download all files for Physics_Watcher_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Physics_Watcher_Script_1.lsl
1
2 1 // Remove That 1 to make the Script Running
3 // Sometimes when crossing sim borders, physics will spontaneously be removed from a vehicle.
4 // This script re-enables physics if that happens.
5
6 integer active = TRUE;
7
8 default {
10 //llListen(0, "", NULL_KEY, "brake");
11 //llListen(0, "", NULL_KEY, "b");
12 llSetTimerEvent(1.0);
13 }
14
15 timer() {
16 if(active) {
19 llSleep(1.0);
21 }
22 } else {
23 active = FALSE;
24 llSetTimerEvent(0.0);
25 }
26 } else {
27 llSetTimerEvent(0.0);
29 }
30 }
31
32 listen(integer channel, string name, key id, string message) {
33 string myMessage = llToLower(message);
34 if(id == llGetOwner()) {
35 if(myMessage == "b" || myMessage == "brake") {
36 if(active) {
37 active = FALSE;
38 llWhisper(0, "Emergency brake engaged! Say 'b' in chat to resume flight.");
39 } else {
40 active = TRUE;
41 llSetTimerEvent(1.0);
42 llWhisper(0, "Emergency brake disengaged.");
43 }
44 }
45 }
46 }
47
48 link_message(integer sender, integer num, string message, key id) {
49 if(message == "throttle" || message == "engines on") {
50 if(message == "throttle" && active == FALSE) {
51 llWhisper(0, "Emergency brake disengaged.");
52 }
53 active = TRUE;
54 llSetTimerEvent(1.0);
55 }
56 }
57 }
58 // END //

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