Join us in Outworldz at http://www.outworldz.com:9000 or follow us:

[Table of Contents]

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
Crate Breakable_Crate  

Breakable_Crate

After the success of the breakable crate, I also decided to make some modified copies--A breakable wooden pallet, barrel, and explodable barrel...The main difference being the sounds that were used for collisions and destructions. For the sake of not uploading duplicate scripts, the sounds for the other versions of this script can be found in our list of Sound Keys.

Category: Crate
By : Davy Maltz
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Breakable_Crate
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Breakable_Crate_1.lsl
1 list breaksound = ["1ceaa00b-95a4-9b37-5c76-dbd711128fe5","22f44b4c-e9e7-9070-074c-2979813768b1","7c2b0c79-4cb5-51f4-90f5-ec3adce56f03","a9f429ec-6cca-777d-1517-7cd79df88043"];
2 list collisionsound = ["2d968abb-4c3d-61f9-572a-b380969d9327","20d17901-8e0c-d3cf-4390-2db00524f59e","305e1068-1650-38d6-ee80-0f2dd7d7c95d"];
3 default
4 {
6 {
7 llCollisionSound("",0.0);
8 }
9 touch_start(integer num_detected)
10 {
12 }
13 sensor(integer num_detected)
14 {
15 llTriggerSound("1d7b6b0f-df02-d797-3b32-75076af654f1",1.0);
17 }
18 collision_start(integer num_detected)
19 {
20 llPlaySound(llList2String(collisionsound,(integer)llFrand(llGetListLength(collisionsound))),llVecMag(llGetVel()) / 3);
21 if(llVecMag(llDetectedVel(0)) > 10)
22 {
24 llRezObject("Broken Crate",llGetPos(),llGetVel(),llGetRot(),0);
26 llTriggerSound(llList2String(breaksound,(integer)llFrand(llGetListLength(breaksound))),1.0);
27 llDie();
28 }
29 else if(llVecMag(llGetVel()) > 7)
30 {
32 llRezObject("Broken Crate",llGetPos(),llGetVel(),llGetRot(),0);
34 llTriggerSound(llList2String(breaksound,(integer)llFrand(llGetListLength(breaksound))),1.0);
35 llDie();
36 }
37 }
38 land_collision_start(vector pos)
39 {
40 llPlaySound(llList2String(collisionsound,(integer)llFrand(llGetListLength(collisionsound))),llVecMag(llGetVel()) / 4);
41 if(llVecMag(llGetVel()) > 7)
42 {
44 llRezObject("Broken Crate",llGetPos(),llGetVel(),llGetRot(),0);
45 llTriggerSound(llList2String(breaksound,(integer)llFrand(llGetListLength(breaksound))),1.0);
46 llDie();
47 }
48 }
49 }

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