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
Water L6a2wateranimationwithsound  

L6a2wateranimationwithsound

L6a.2-water-animation-with-sound.lsl

Category: Water
By : Dana Moore
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for L6a2wateranimationwithsound
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. L6a2wateranimationwithsound_1.lsl
1
2 // Copyright (c) 2008, Scripting Your World
3 // All rights reserved.
4 //
5 // Scripting Your World
6 // By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh
7 // http://syw.fabulo.us
8 // http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/
9 //
10 // You are permitted to use, share, and adapt this code under the
11 // terms of the Creative Commons Public License described in full
12 // at http://creativecommons.org/licenses/by/3.0/legalcode.
13 // That means you must keep the credits, do nothing to damage our
14 // reputation, and do not suggest that we endorse you or your work.
15
16 // Listing 6a.2: Improved Water Animation-Extending Listing 6.2 with Sound
17
18 float randBetween(float min, float max){
19 return llFrand(max - min) + min;
20 }
21 default {
22 state_entry() {
23 float rand = llFrand(10.0);
24 llSetTimerEvent(rand);
25 }
26 timer() {
27 state fallingWater;
28 }
29 }
30
31 state fallingWater {
32 state_entry() {
33 float rate = randBetween(0.05, 0.35);
34 if(rate > 0.30) {
35 llTriggerSound("water-flowing3", 0.8);
36 }
37 llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1.0, 0.0, rate);
38 llSleep(1.5);
39 state default;
40 }
41 }
42 // END //

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