Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Vehicles | Anonymous | Car Script (Front Wheel).lsl | |
Car Script (Front Wheel).lsl
Car Script (Front 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 (Front 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 { 23 state_entry() 24 { 25 } 26 28 { 29 if(str == "WHEEL_DRIVING") 30 { 31 state driving; 32 } 33 } 34 35 } 36 37 state driving 38 { 39 state_entry() 40 { 41 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> )); 42 llSetTimerEvent(0.5); 43 } 44 45 timer() 46 { 50 } 51 53 { 54 if(str == "WHEEL_DEFAULT") 55 { 56 state default; 57 } 58 59 if(str == "WHEEL_FORWARD") 60 { 61 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> )); 62 } 63 64 if(str == "WHEEL_REVERSE") 65 { 66 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> )); 67 } 68 69 if(str == "WHEEL_LEFT") 70 { 72 } 73 74 if(str == "WHEEL_RIGHT") 75 { 77 } 78 79 } 80 81 state_exit() 82 { 83 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> )); 85 } 86 87 } 88 // END //