Second Life hoje em um só lugar Presentes e freebies atualizados a cada hora 7 idiomas Grátis para divulgar sua loja
Problema no grid
  • Programado: Scheduled Billing Maintenance, seg., 16 de nov. 09:30–10:30 SLT
  • Status do grid: Unscheduled Group Chat Maintenance (investigating)
  • Agora: Culto Unitarian Universalist de Sábado em UUtopia
  • Agora: The Dharma of Community: Sociedade Budista e o Householder
  • Agora: Harvest Fest da SLCS: jogos, música e diversão
  • 14:00 SLT: NAD GOUGH ao vivo no Moondance em Cascadia, 14:00 SLT
  • Notícias: REZZ MALL: marcas de Second Life em um shopping online
  • Viewer: Second Life Viewer 26.5 traz modernização do chat
  • Programado: Scheduled Billing Maintenance, seg., 16 de nov. 09:30–10:30 SLT
  • Status do grid: Unscheduled Group Chat Maintenance (investigating)
  • Agora: Culto Unitarian Universalist de Sábado em UUtopia
  • Agora: The Dharma of Community: Sociedade Budista e o Householder
  • Agora: Harvest Fest da SLCS: jogos, música e diversão
  • 14:00 SLT: NAD GOUGH ao vivo no Moondance em Cascadia, 14:00 SLT
  • Notícias: REZZ MALL: marcas de Second Life em um shopping online
  • Viewer: Second Life Viewer 26.5 traz modernização do chat
Script LSL

LSL sound loop script for ambient sound

Free LSL ambient sound script for Second Life: loop birds, waves, rain or a fire crackle from any object, set the volume and touch to turn it on and off.

52 linhas ·

Sound brings a place to life: waves on a beach, birds in a garden, a crackling fireplace. This sound loop script plays a sound on repeat from any object, with a volume setting and touch to switch it on or off.

lsl-sound-loop-script.lsl · 52 linhas Verificar este script
// Ambient Sound Loop - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-sound-loop-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Plays a sound on repeat: birds, waves, a fire, rain, a shop jingle.
// Put a sound in the object's Contents (or paste a sound UUID into SOUND_NAME). Touch to turn it on and off.

string  SOUND_NAME   = "";    // "" = the first sound in Contents; or a sound name or UUID
float   SOUND_VOLUME = 0.6;   // 0.0 to 1.0; keep ambient sounds soft
integer START_ON     = TRUE;
integer OWNER_ONLY   = FALSE; // TRUE = only the owner can turn it on and off

integer gOn = FALSE;

string soundToPlay()
{
    if (SOUND_NAME != "") return SOUND_NAME;
    return llGetInventoryName(INVENTORY_SOUND, 0);
}

setSound(integer on)
{
    llStopSound();
    gOn = FALSE;
    if (!on) return;
    string snd = soundToPlay();
    if (snd == "")
    {
        llOwnerSay("Put a sound in my Contents, or set SOUND_NAME.");
        return;
    }
    llLoopSound(snd, SOUND_VOLUME);
    gOn = TRUE;
}

default
{
    state_entry()
    {
        setSound(START_ON);
    }

    touch_start(integer total)
    {
        if (OWNER_ONLY && llDetectedKey(0) != llGetOwner()) return;
        setSound(!gOn);
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY) setSound(gOn);
    }
}

Livre para usar, alterar e colocar nas suas criações, inclusive nas que você vende.

How to set it up

  1. Put a sound into the object's Contents (or copy a sound's UUID).
  2. Add the script and save. The sound starts playing.
  3. Touch the object to stop it and touch again to start it.

Settings

  • SOUND_NAME: empty plays the first sound in the Contents. You can also type a sound name or paste a sound UUID.
  • SOUND_VOLUME: 0.0 to 1.0. Ambient sounds sound best soft, around 0.3 to 0.6.
  • START_ON: whether the sound plays as soon as the script starts.
  • OWNER_ONLY: TRUE stops visitors from switching it off.

Tips

  • Use sounds that are made to loop, without a gap or click at the end.
  • Visitors hear the sound near the object. Place several quiet sources around a big area rather than one loud one.
  • For music for a whole parcel, use the parcel's music stream instead of a sound loop.

Frequently asked questions

Why can't I hear anything?

Check that sound effects are turned up in your viewer's volume controls, that the object has a sound in its Contents, and that you are close enough to the object.

Can I play several sounds in a row?

This script loops one sound. Playing a list of sounds needs llPlaySound with a timer for each clip.

Does a sound loop cause lag?

Very little. The region tells viewers to loop the sound once; the viewer does the rest.

Verifique seu próprio script: Verificador de sintaxe LSL →

Mais scriptsTodos os scripts
Script LSL · 55 linhas

Script de porta LSL: toque para abrir, fecha sozinha

Script de porta LSL grátis para Second Life. Toque para abrir e fechar: a porta gira na dobradiça e se fecha sozinha após alguns segundos. Sons opcionais.

Script LSL · 69 linhas

LSL sit and pose script for chairs and pose balls

Free LSL sit script for Second Life chairs, benches and pose balls: sit and play your own animation, set the sit position, hide the ball while in use.

Script LSL · 96 linhas

LSL tip jar script with thank-you message and total

Free LSL tip jar script for Second Life clubs, DJs, hosts and stores: quick pay buttons, a thank-you message, the total and last tipper in floating text.