Join us in Phaze Demesnes

LSL Script Library Home   Add a script Show All
Category: Contributor: Description
Vehicles Anonymous Car Script (Rear Wheel).lsl
Car Script (Rear Wheel).lsl
Car Script (Rear Wheel).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:Vehicles
2 // DESCRIPTION:Car Script (Rear Wheel).lsl
3 // ARCHIVED BY:Ferd Frederix
4
6 {
7 r.x = -r.x;
8 r.y = -r.y;
9 r.z = -r.z;
10 return r;
11 }
12 rotation GetParentRot()
13 {
14 return Inverse(llGetLocalRot())*llGetRot();
15 }
16 SetLocalRot(rotation x)
17 {
18 llSetRot(x*Inverse(GetParentRot()));
19 }
20
21 default
22 {
24 {
25 }
26
28 {
29
30 if(str == "WHEEL_DRIVING")
31 {
32 state driving;
33 }
34
35 }
36
37 }
38
39 state driving
40
41 {
43 {
44 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
45 llSetTimerEvent(0.5);
46 }
47
48 timer()
49 {
50 vector vel = llGetVel();
51 float speed = llVecMag(vel);
52 llSetTextureAnim(ANIM_ON|LOOP|SMOOTH|ROTATE,ALL_SIDES,0,0,0,0,speed);
53 }
54
56 {
57 if(str == "WHEEL_DEFAULT")
58 {
59 state default;
60 }
61
62 }
63
65 {
66 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
67 llSetTextureAnim(0,ALL_SIDES,0,0,0,0,0);
68 }
69
70 }
71 // END //