Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Do not sell this; Karma knowz where you live ☠
- // How-to/Info:
- // Put this script with some sound clips (numbered so they play in order)
- // into a prim, then change the below values to suit your needs!!!
- // Example, change the sound_length to match how long your sound clips are
- float sound_length = 9.76;//How long the sound clips are
- float sound_volume = 1.0;//from 0.00 to 1.00
- float slow_server_adjustment = 0.00;//..
- float text_alpha = 0.5;//how visible floating text is, from 0.00 to 1.00
- vector text_color = <1,2,3>;//color of the floating text
- integer num_sounds;//how many sound clips
- integer active = FALSE;//Are we on/TRUE or off/FALSE
- //list sound_list;// not needed for this job
- integer loop_sounds(){
- active = TRUE;
- integer sound;//first sound in the inventory
- for(; sound < num_sounds; ++sound){
- //llOwnerSay((string)sound + " - "+llGetInventoryName(INVENTORY_SOUND, sound));
- llTriggerSound(llGetInventoryName(INVENTORY_SOUND, sound), sound_volume);
- llSleep(sound_length);
- }
- return TRUE;
- }
- load_sounds(){
- integer sound;
- for(; sound < num_sounds; ++sound){
- string s = llGetInventoryName(INVENTORY_SOUND, sound);
- // llSetText("• Preloading Sound • \n"+s, text_color, text_alpha);
- llPreloadSound(s);
- }llSetText(" ", text_color, text_alpha);
- }
- integer count_sounds(){
- integer i;
- integer n = llGetInventoryNumber(INVENTORY_SOUND);
- list result = [];
- for(i = 0; i < n; i++){
- result += [llGetInventoryName(INVENTORY_SOUND, i)];
- }//sound_list = result;
- return llGetListLength(result);
- }
- integer Play()
- {
- num_sounds = count_sounds();
- load_sounds();
- // llSetTimerEvent((num_sounds * sound_length)-(num_sounds * slow_server_adjustment));
- // llWhisper(0,"/me • Playing.");
- if (loop_sounds() == TRUE)
- {
- return TRUE;
- }
- else
- { return FALSE;}
- }
- string help = "• Help / Usage •
- 1. Load sounds into the prim that has this script inside.
- 2. Open the script and find the \"sound_length\" value.
- 3. Change that value to match how your sound clips are.
- 4. Touch the object, wait for the sounds to preload.. Done!
- Note: Uncomment the line in the touch_event to make it \"owner only\".";
- default{
- //
- //
- changed(integer c){
- if(c & CHANGED_OWNER){
- llWhisper(0,"/me "+help);
- llResetScript();
- }
- else if(c & CHANGED_REGION_START)
- {
- llResetScript();
- }
- }
- //
- //on_rez(integer num_detected){
- collision_start(integer total_number)
- {
- state play_sound;
- }
- //
- timer(){
- loop_sounds();
- }
- //
- }
- state play_sound
- {
- state_entry()
- {
- if(Play() == TRUE)
- state default;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement