Difference between revisions of "MLPV2 Ambiant Sound Add-on"
Jump to navigation
Jump to search
m (+Category:MLPV2) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
* Back to [[MLPV2_Addons]] | |||
* [[MLPV2]] | * [[MLPV2]] | ||
* [[MLPV2_Texture_Changer_Add-on]] | * [[MLPV2_Texture_Changer_Add-on]] | ||
Line 18: | Line 19: | ||
#Add to the menu in an MLPV2 menu notecard the following line(s): | #Add to the menu in an MLPV2 menu notecard the following line(s): | ||
LINKMSG PlaySound1 | 0,-4,989999,SoundName | |||
LINKMSG PlaySound2 | 0,-4,989999,SoundName2 | |||
LINKMSG StopSound | 0,-4,989999,stoploop | |||
In the above line, there are elements for you to customize as appropriate: | |||
* PlaySound/StopSound : these are the button labels (in the menu) | |||
* SoundName1 and SoundName2 : the name of the sound (in inventory) | |||
You can have any number of different sounds. | |||
<lsl> | <lsl> | ||
// SOUND_SCRIPT | // SOUND_SCRIPT (MULTIPLE) | ||
//add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009. | // add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009. | ||
// STOP feature added by Lear Cale | |||
default | default { | ||
{ | link_message(integer sender_num, integer num, string str, key id) { | ||
link_message(integer sender_num, integer num, string str, key id) | if (num == 0 && str == "STOP") { | ||
{ | llStopSound(); | ||
if (num ==989999) | } else if (num == 989999) { | ||
llStopSound(); | |||
if (str | if (str != "stoploop") { | ||
llStopSound(); | |||
} | llLoopSound(str, .5); // .5 is the volume of the played sound - must be between 0.0 (silent) and 1.0 (loudest) | ||
} | } | ||
} | |||
} | |||
} | } | ||
</lsl> | </lsl> | ||
[[Category:MLPV2]] | |||
Latest revision as of 08:23, 25 December 2011
- Back to MLPV2_Addons
- MLPV2
- MLPV2_Texture_Changer_Add-on
- MLPV2_Props_Texture_Changer_Add-on
- MLPV2_Color_Changer_Add-on
Simple add on tool for MLPV2 that puts a button on the MLPV2 menu that, when clicked, play a looped sound in the content of the prim where the MLPV2 scripts are.
(This script won't work for props, only for the prim where the MLPV2 scripts are, and the prims linked to it)
By Teq Hutchinson, November 2009.
Steps to use:
- Copy and paste the Sound_Script on this page into a script called as you want;
- Drop this script into the prim where you have the rest of the MLPV2 scripts;
- Drop the sound you want to be played into the prim where you have the rest of the MLPV2 scripts;
- Add to the menu in an MLPV2 menu notecard the following line(s):
LINKMSG PlaySound1 | 0,-4,989999,SoundName LINKMSG PlaySound2 | 0,-4,989999,SoundName2 LINKMSG StopSound | 0,-4,989999,stoploop
In the above line, there are elements for you to customize as appropriate:
- PlaySound/StopSound : these are the button labels (in the menu)
- SoundName1 and SoundName2 : the name of the sound (in inventory)
You can have any number of different sounds.
<lsl> // SOUND_SCRIPT (MULTIPLE) // add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009. // STOP feature added by Lear Cale
default {
link_message(integer sender_num, integer num, string str, key id) { if (num == 0 && str == "STOP") { llStopSound(); } else if (num == 989999) { llStopSound(); if (str != "stoploop") { llStopSound(); llLoopSound(str, .5); // .5 is the volume of the played sound - must be between 0.0 (silent) and 1.0 (loudest) } } }
} </lsl>